diff --git a/src/helper.c b/src/helper.c index 72f81fe..dcae96c 100644 --- a/src/helper.c +++ b/src/helper.c @@ -740,9 +740,11 @@ static unsigned char *grab_extradata_lua(unsigned char *buf, unsigned char *end, if (!buf || (buf == end)) return NULL; - for (next = buf; *next != 0; next++) + for (next = buf; ; next++) if (next == end) return NULL; + else if (*next == 0) + break; if (next != buf) {