Commit 205fba74 authored by Max Kellermann's avatar Max Kellermann

tag/ApeLoader: fix buffer overflow after unterminated key

parent a9bcf8d5
ver 0.19.11 (not yet released)
* tags
- ape: fix buffer overflow
ver 0.19.10 (2015/06/21)
* input
......
......@@ -78,12 +78,12 @@ ape_scan_internal(FILE *fp, ApeTagCallback callback)
/* get the key */
const char *key = p;
while (remaining > size && *p != '\0') {
p++;
remaining--;
}
p++;
remaining--;
const char *key_end = (const char *)memchr(p, '\0', remaining);
if (key_end == nullptr)
break;
p = key_end + 1;
remaining -= p - key;
/* get the value */
if (remaining < size)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment