summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorliuxueli <[email protected]>2021-10-26 15:43:52 +0800
committerliuxueli <[email protected]>2021-10-26 15:43:52 +0800
commit1acf1e88819e4a55e5c8461a29f282a699a82f47 (patch)
treec57359598c1b719e2c4934a8772ae02eaeef7e10 /src
parent014ff01e3148d6e6de9148a3b64a8e7d7c2340e3 (diff)
TSG-8201: 删除空行后剩余长度为0,未对长度进行校验导致处理过程中出现异常v2.0.8
Diffstat (limited to 'src')
-rw-r--r--src/HTTP_Parser.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/HTTP_Parser.c b/src/HTTP_Parser.c
index 19fe4de..9a0e61b 100644
--- a/src/HTTP_Parser.c
+++ b/src/HTTP_Parser.c
@@ -86,6 +86,11 @@ int http_host_parser(const char* buf, uint32 buflen, int http_dir, char** host)
uchar method = HTTP_METHOD_UNKNOWN;
int method_idx = 1, new_flags=0;
+ if(pbuflen<4) //g_http_method min bytes=3; pbuflen_temp=pbuflen
+ {
+ return -1;
+ }
+
//printf("buf=====================================================\n");
//printf("%s\n", buf);