summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-03-04 15:53:51 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-03-04 15:53:51 +0000
commite134b338c1f661c4dd72996ef71ed510047354f2 (patch)
tree9e6d0abfd8de9fc4da03ba4e5002c41961f4b032
parent69604f44197203c0859a7af24a13b1dd5abc75ab (diff)
downloaduhttpd-e134b338c1f661c4dd72996ef71ed510047354f2.tar.gz
[package] uhttpd: cope with variable number of spaces in header lines (#11079)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@30806 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--uhttpd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/uhttpd.c b/uhttpd.c
index 3563d91..9b96086 100644
--- a/uhttpd.c
+++ b/uhttpd.c
@@ -337,11 +337,14 @@ static struct http_request * uh_http_header_parse(struct client *cl, char *buffe
}
/* have name but no value and found a colon, start of value */
- else if( hdrname && !hdrdata && ((i+2) < buflen) &&
- (buffer[i] == ':') && (buffer[i+1] == ' ')
+ else if( hdrname && !hdrdata &&
+ ((i+1) < buflen) && (buffer[i] == ':')
) {
buffer[i] = 0;
- hdrdata = &buffer[i+2];
+ hdrdata = &buffer[i+1];
+
+ while ((hdrdata + 1) < (buffer + buflen) && *hdrdata == ' ')
+ hdrdata++;
}
/* have no name and found [A-Za-z], start of name */