diff --git a/src/proto_http.c b/src/proto_http.c index bf21ca9c8..2cd58d2c9 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -552,7 +552,7 @@ int http_find_header2(const char *name, int len, eol = find_hdr_value_end(sov, eol); ctx->tws = 0; - while (http_is_lws[(unsigned char)*(eol - 1)]) { + while (eol > sov && http_is_lws[(unsigned char)*(eol - 1)]) { eol--; ctx->tws++; }