Commit 7a3ce8da authored by Nikias Bassen's avatar Nikias Bassen

xplist: Make sure to error out when encountering empty/incomplete entities

parent 3abf4ffb
......@@ -640,7 +640,8 @@ static int unescape_entities(char *str, size_t *length)
i++;
}
if (i >= len) {
break;
PLIST_XML_ERR("Invalid entity sequence encountered (missing terminating ';')\n");
return -1;
}
if (str+i >= entp+1) {
int entlen = str+i - entp;
......@@ -714,6 +715,9 @@ static int unescape_entities(char *str, size_t *length)
i -= entlen+1 - bytelen;
len -= entlen+2 - bytelen;
continue;
} else {
PLIST_XML_ERR("Invalid empty entity sequence &;\n");
return -1;
}
}
i++;
......
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