From 0063f766c5ded3e56c536b325275be7cb48d3bd3 Mon Sep 17 00:00:00 2001 From: kvic Date: Sun, 10 Dec 2017 22:14:17 +0800 Subject: [PATCH] Bypass when POST length unknown --- socket_handler.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/socket_handler.c b/socket_handler.c index 1cd90a6..b32dd24 100644 --- a/socket_handler.c +++ b/socket_handler.c @@ -592,9 +592,11 @@ void* conn_handler( void *ptr ) int length = 0; int post_buf_size = 0; int wait_cnt = 0; - char *h = strstr(bufptr, "Content-Length: "); + char *h = strstr(bufptr, "Content-Length:"); - h += strlen("Content-Length: "); + if (!h) + goto end_post; + h += strlen("Content-Length:"); length = atoi(strtok(h, "\r\n")); log_msg(LGG_DEBUG, "POST socket: %d Content-Length: %d", new_fd, length);