Commit a988b9b0 authored by Max Kellermann's avatar Max Kellermann

ape: check the tag size (fixes integer underflow)

The expression "tagLen - size > 0" may result in an integer underflow and a buffer overflow, when "size" is larger than "tagLen". "size" is read from the input file, and must not be trusted. This patch changes the expression to "tagLen > size", which is a lot safer.
parent c8c91d9a
ver 0.15.2 (2009/??/??)
* tags:
- ape: check the tag size (fixes integer underflow)
ver 0.15.1 (2009/07/15)
......
......@@ -112,7 +112,7 @@ tag_ape_load(const char *file)
/* get the key */
key = p;
while (tagLen - size > 0 && *p != '\0') {
while (tagLen > size && *p != '\0') {
p++;
tagLen--;
}
......
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