summaryrefslogtreecommitdiffstats
path: root/src/xplist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xplist.c')
-rw-r--r--src/xplist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xplist.c b/src/xplist.c
index 36db07d..9825a28 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -662,7 +662,9 @@ static void node_from_xml(parse_ctx ctx, plist_t *plist)
return;
}
if (*(ctx->pos-1) == '/') {
- tag[ctx->pos - p - 1] = '\0';
+ int idx = ctx->pos - p - 1;
+ if (idx < taglen)
+ tag[idx] = '\0';
is_empty = 1;
}
ctx->pos++;