summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2017-01-02 00:19:18 +0100
committerGravatar Nikias Bassen2017-01-02 00:19:18 +0100
commit3abf4ffb312f1ebb040e0389f4409312e0539426 (patch)
treeab7ed9a93468ac000c2fc2d4dd74a853f5d8ee15
parent02e9c0a590a27b3a98da03f3d7bfcf25621ff7fc (diff)
downloadlibplist-3abf4ffb312f1ebb040e0389f4409312e0539426.tar.gz
libplist-3abf4ffb312f1ebb040e0389f4409312e0539426.tar.bz2
xplist: Make sure to not parse for entities in empty strings
-rw-r--r--src/xplist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xplist.c b/src/xplist.c
index ddd962e..b1bdd46 100644
--- a/src/xplist.c
+++ b/src/xplist.c
@@ -633,7 +633,7 @@ static int unescape_entities(char *str, size_t *length)
{
size_t i = 0;
size_t len = *length;
- while (i < len-1) {
+ while (len > 0 && i < len-1) {
if (str[i] == '&') {
char *entp = str + i + 1;
while (i < len && str[i] != ';') {