From 5b8850550fb1099c0b8b5243770fb3afe806282a Mon Sep 17 00:00:00 2001 From: Xuan Sang LE Date: Sat, 17 Mar 2018 20:54:38 +0100 Subject: [PATCH] fix invalid read --- http_server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/http_server.c b/http_server.c index 33dd201..f3a59e6 100644 --- a/http_server.c +++ b/http_server.c @@ -518,7 +518,8 @@ dictionary decode_request(void* client,const char* method, char* url) token = strsep(&line,":"); trim(token,' '); trim(line,' '); - dput(xheader,token,strdup(line)); + if(token && line && strlen(line) > 0) + dput(xheader,token,strdup(line)); if(token != NULL &&strcasecmp(token,"Cookie") == 0) { if(!cookie) cookie = decode_cookie(line);