From 3abf4ffb312f1ebb040e0389f4409312e0539426 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 2 Jan 2017 00:19:18 +0100 Subject: xplist: Make sure to not parse for entities in empty strings --- src/xplist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xplist.c') 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] != ';') { -- cgit v1.1-32-gdbae