summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2017-02-07 03:32:32 +0100
committerGravatar Nikias Bassen2017-02-07 03:32:32 +0100
commit322b2c9dc4d50ee466c3fb1263b10282009a63cc (patch)
treea322807fe715bd9aae96ea49eabd511fe5467043
parent234c41cd7eead5e5a68dbaa80d26335a19cd1d83 (diff)
downloadlibplist-322b2c9dc4d50ee466c3fb1263b10282009a63cc.tar.gz
libplist-322b2c9dc4d50ee466c3fb1263b10282009a63cc.tar.bz2
xplist: unescape_entities(): Make sure text part buffer is null terminated after strncpy
-rw-r--r--src/xplist.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/xplist.c b/src/xplist.c
index ec00410..782a71c 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -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);