Skip to content

Commit

Permalink
miniupnpd/upnphttp.c: fix buffer overrun in ParseHttpHeaders() if Con…
Browse files Browse the repository at this point in the history
…tent-Length doesn't contain any digit

Credits goes to Stephen Röttger of the Google Security Team for identifying
the vulnerabilities
  • Loading branch information
miniupnp committed Dec 9, 2014
1 parent e6bc04a commit dd39eca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions miniupnpd/Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $Id: Changelog.txt,v 1.391 2014/12/09 09:48:04 nanard Exp $
fix upnp_add_inboundpinhole() : check inet_pton() return
fix upnp_redirect() : check inet_aton() return
fix potential memory corruption in upnpsoap.c/GetListOfPortMappings()
fix buffer overrun in ParseHttpHeaders() if Content-Length doesn't contain any digit !
Credits goes to Stephen Röttger of the Google Security Team for identifying
the vulnerabilities

Expand Down
4 changes: 2 additions & 2 deletions miniupnpd/upnphttp.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: upnphttp.c,v 1.91 2014/04/09 14:08:12 nanard Exp $ */
/* $Id: upnphttp.c,v 1.94 2014/12/09 09:46:45 nanard Exp $ */
/* Project : miniupnp
* Website : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
* Author : Thomas Bernard
Expand Down Expand Up @@ -223,7 +223,7 @@ ParseHttpHeaders(struct upnphttp * h)
if(strncasecmp(line, "Content-Length", 14)==0)
{
p = colon;
while(*p < '0' || *p > '9')
while((*p < '0' || *p > '9') && (*p != '\r') && (*p != '\n'))
p++;
h->req_contentlen = atoi(p);
if(h->req_contentlen < 0) {
Expand Down

0 comments on commit dd39eca

Please sign in to comment.