uhttpd: fix segmentation fault triggered by invalid header line

SVN-Revision: 22607
lede-17.01
Jo-Philipp Wich 2010-08-12 10:56:41 +00:00
parent 28a93eed3c
commit 4847198093
1 changed files with 2 additions and 1 deletions

View File

@ -266,7 +266,8 @@ static struct http_request * uh_http_header_parse(struct client *cl, char *buffe
}
/* check version */
if( strcmp(version, "HTTP/0.9") && strcmp(version, "HTTP/1.0") && strcmp(version, "HTTP/1.1") )
if( (version == NULL) || (strcmp(version, "HTTP/0.9") &&
strcmp(version, "HTTP/1.0") && strcmp(version, "HTTP/1.1")) )
{
/* unsupported version */
uh_http_response(cl, 400, "Bad Request");