From 00ccb5c80f7cfc3405ec39ce105f0f63a7425151 Mon Sep 17 00:00:00 2001 From: Nathan French Date: Sat, 9 Mar 2019 15:19:23 -0500 Subject: [PATCH] [#128] fix other (potential) problems related #128 --- parser.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/parser.c b/parser.c index 07f0f76..9587455 100644 --- a/parser.c +++ b/parser.c @@ -835,6 +835,10 @@ htparser_run(htparser * p, htparse_hooks * hooks, const char * data, size_t len) HTP_SET_BUF(ch); } + if (evhtp_unlikely(i + 1 >= len)) { + break; + } + ch = data[++i]; } while (i < len); @@ -1319,6 +1323,10 @@ htparser_run(htparser * p, htparse_hooks * hooks, const char * data, size_t len) break; } + if (evhtp_unlikely(i + 1 >= len)) { + break; + } + ch = data[++i]; } while (i < len); @@ -1734,6 +1742,10 @@ htparser_run(htparser * p, htparse_hooks * hooks, const char * data, size_t len) break; } + if (evhtp_unlikely(i + 1 >= len)) { + break; + } + ch = data[++i]; } while (i < len);