aboutsummaryrefslogtreecommitdiffstats
path: root/package/uhttpd
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-08-12 10:56:41 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-08-12 10:56:41 +0000
commit48471980935097fbdc4e2f27b68636c55db48bd9 (patch)
tree43cf2ec3150033326df207f05ccbfe3878beef66 /package/uhttpd
parent28a93eed3c125d4aef983cca05c56f93d484fa5d (diff)
downloadupstream-48471980935097fbdc4e2f27b68636c55db48bd9.tar.gz
upstream-48471980935097fbdc4e2f27b68636c55db48bd9.tar.bz2
upstream-48471980935097fbdc4e2f27b68636c55db48bd9.zip
uhttpd: fix segmentation fault triggered by invalid header line
SVN-Revision: 22607
Diffstat (limited to 'package/uhttpd')
-rw-r--r--package/uhttpd/src/uhttpd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/package/uhttpd/src/uhttpd.c b/package/uhttpd/src/uhttpd.c
index 247eb79752..764ff7d570 100644
--- a/package/uhttpd/src/uhttpd.c
+++ b/package/uhttpd/src/uhttpd.c
@@ -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");