summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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] != ';') {