projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
42d15c0
)
uhttpd: accept wrongly terminated cgi headers, needed for X-Wrt
author
Jo-Philipp Wich
<jow@openwrt.org>
Fri, 19 Mar 2010 13:32:24 +0000
(13:32 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Fri, 19 Mar 2010 13:32:24 +0000
(13:32 +0000)
contrib/package/uhttpd/src/uhttpd-cgi.c
patch
|
blob
|
history
diff --git
a/contrib/package/uhttpd/src/uhttpd-cgi.c
b/contrib/package/uhttpd/src/uhttpd-cgi.c
index
2a9fdc9
..
93caf5a
100644
(file)
--- a/
contrib/package/uhttpd/src/uhttpd-cgi.c
+++ b/
contrib/package/uhttpd/src/uhttpd-cgi.c
@@
-12,9
+12,10
@@
static struct http_response * uh_cgi_header_parse(char *buf, int len, int *off)
static struct http_response res;
- if( (bufptr = strfind(buf, len, "\r\n\r\n", 4)) != NULL )
- {
- *off = (int)(bufptr - buf) + 4;
+ if( ((bufptr = strfind(buf, len, "\r\n\r\n", 4)) != NULL) ||
+ ((bufptr = strfind(buf, len, "\n\n", 2)) != NULL)
+ ) {
+ *off = (int)(bufptr - buf) + ((bufptr[1] == '\r') ? 4 : 2);
memset(&res, 0, sizeof(res));