Commit 322b2c9d authored by Nikias Bassen's avatar Nikias Bassen

xplist: unescape_entities(): Make sure text part buffer is null terminated after strncpy

parent 234c41cd
......@@ -783,6 +783,7 @@ static char* text_parts_get_content(text_part_t *tp, int unesc_entities, size_t
while (tp && tp->begin) {
size_t len = tp->length;
strncpy(p, tp->begin, len);
p[len] = '\0';
if (!tp->is_cdata && unesc_entities) {
if (unescape_entities(p, &len) < 0) {
free(str);
......
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