miniwget.c: fixed potential buffer overrun

This commit is contained in:
Thomas Bernard 2013-12-09 09:25:39 +01:00
parent b0c66c01e2
commit 3a87aa2f10
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,9 @@
$Id: Changelog.txt,v 1.187 2013/06/06 21:36:39 nanard Exp $ $Id: Changelog.txt,v 1.187 2013/06/06 21:36:39 nanard Exp $
miniUPnP client Changelog. miniUPnP client Changelog.
2013/10/07:
fixed potential buffer overrun in miniwget.c
2013/08/01: 2013/08/01:
define MAXHOSTNAMELEN if not already done define MAXHOSTNAMELEN if not already done

View File

@ -162,7 +162,7 @@ getHTTPResponse(int s, int * size)
chunked = 1; chunked = 1;
} }
} }
while(header_buf[i]=='\r' || header_buf[i] == '\n') while((i < (int)header_buf_used) && (header_buf[i]=='\r' || header_buf[i] == '\n'))
i++; i++;
linestart = i; linestart = i;
colon = linestart; colon = linestart;