[package] uhttpd: cope with variable number of spaces in header lines (#11079)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30806 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
Jo-Philipp Wich 2012-03-04 15:53:51 +00:00
parent 0298468ecf
commit 81f7a21315
2 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,5 @@
# #
# Copyright (C) 2010-2011 Jo-Philipp Wich <xm@subsignal.org> # Copyright (C) 2010-2012 Jo-Philipp Wich <xm@subsignal.org>
# #
# This is free software, licensed under the GNU General Public License v2. # This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information. # See /LICENSE for more information.
@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=uhttpd PKG_NAME:=uhttpd
PKG_RELEASE:=30 PKG_RELEASE:=31
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_CONFIG_DEPENDS := \ PKG_CONFIG_DEPENDS := \

View File

@ -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 */ /* have name but no value and found a colon, start of value */
else if( hdrname && !hdrdata && ((i+2) < buflen) && else if( hdrname && !hdrdata &&
(buffer[i] == ':') && (buffer[i+1] == ' ') ((i+1) < buflen) && (buffer[i] == ':')
) { ) {
buffer[i] = 0; 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 */ /* have no name and found [A-Za-z], start of name */