summaryrefslogtreecommitdiff
path: root/package/uhttpd/src
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-03-04 15:53:51 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-03-04 15:53:51 +0000
commit8533636d2d106ed19c752239c866fc89bcefffc2 (patch)
tree7a640d4bb685d0156d58f7aee84005bbe884cc8b /package/uhttpd/src
parent086cae30ce9310fa7dc785d1a0c4cb8b487bc948 (diff)
downloadmtk-20170518-8533636d2d106ed19c752239c866fc89bcefffc2.zip
mtk-20170518-8533636d2d106ed19c752239c866fc89bcefffc2.tar.gz
mtk-20170518-8533636d2d106ed19c752239c866fc89bcefffc2.tar.bz2
uhttpd: cope with variable number of spaces in header lines (#11079)
SVN-Revision: 30806
Diffstat (limited to 'package/uhttpd/src')
-rw-r--r--package/uhttpd/src/uhttpd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/package/uhttpd/src/uhttpd.c b/package/uhttpd/src/uhttpd.c
index 3563d91..9b96086 100644
--- a/package/uhttpd/src/uhttpd.c
+++ b/package/uhttpd/src/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 */