uhttpd: fix wrongly applied sizeof() leading to writing beyound end of buffer and subsequent data corruption (#11557)

SVN-Revision: 32005
This commit is contained in:
Jo-Philipp Wich 2012-05-30 15:30:07 +00:00
parent 3fc76fb781
commit 5aefe3b277
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uhttpd
PKG_RELEASE:=33
PKG_RELEASE:=34
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_CONFIG_DEPENDS := \

View File

@ -385,10 +385,10 @@ static struct http_request * uh_http_header_recv(struct client *cl)
char *bufptr = cl->httpbuf.buf;
char *idxptr = NULL;
ssize_t blen = sizeof(cl->httpbuf)-1;
ssize_t blen = sizeof(cl->httpbuf.buf)-1;
ssize_t rlen = 0;
memset(bufptr, 0, sizeof(cl->httpbuf));
memset(bufptr, 0, sizeof(cl->httpbuf.buf));
while (blen > 0)
{