Disallow zero-length entity
authorRicardo Mones <ricardo@mones.org>
Thu, 4 Oct 2018 08:49:32 +0000 (10:49 +0200)
committerRicardo Mones <ricardo@mones.org>
Thu, 4 Oct 2018 08:49:32 +0000 (10:49 +0200)
src/entity.c

index aa0c543..fcf4c28 100644 (file)
@@ -325,7 +325,7 @@ static gchar* entity_extract_to_buffer(gchar *p, gchar b[])
                b[i] = *p;
                ++i, ++p;
        }
-       if (*p != ';' || i == ENTITY_MAX_LEN)
+       if (*p != ';' || i == 0 || i == ENTITY_MAX_LEN)
                return NULL;
        b[i] = '\0';