[package] uhttpd: fix segmentation fault triggered by invalid header line
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 12 Aug 2010 10:56:41 +0000 (10:56 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Thu, 12 Aug 2010 10:56:41 +0000 (10:56 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22607 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/uhttpd/src/uhttpd.c

index 247eb79..764ff7d 100644 (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");
This page took 0.032169 seconds and 4 git commands to generate.