1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-16 00:00:07 +01:00

coverity 169273 - off-by-one on cgi chunking swallow limit

This commit is contained in:
Andy Green 2016-08-28 09:28:55 +08:00
parent d6761e87b5
commit 01020b60f6

View file

@ -2659,7 +2659,7 @@ lws_chunked_html_process(struct lws_process_html_args *args,
if (!s->pos)
s->start = sp;
s->swallow[s->pos++] = *sp;
if (s->pos == sizeof(s->swallow))
if (s->pos == sizeof(s->swallow) - 1)
goto skip;
for (n = 0; n < s->count_vars; n++)
if (!strncmp(s->swallow, s->vars[n], s->pos)) {