diff --git a/http_parser.c b/http_parser.c index 2ea228e..60a10a1 100644 --- a/http_parser.c +++ b/http_parser.c @@ -1497,9 +1497,10 @@ reexecute: switch (h_state) { case h_general: { - const char* limit = p + MIN(data + len - p, max_header_size); + size_t left = data + len - p; + const char* pe = p + MIN(left, max_header_size); - for (; p != limit; p++) { + for (; p != pe; p++) { ch = *p; if (ch == CR || ch == LF) { --p;