upnphttp.c: remove strchr() call in ParseHttpHeaders()

This commit is contained in:
Thomas Bernard 2013-01-29 22:55:57 +01:00
parent 72e570186c
commit ea141830f6
2 changed files with 11 additions and 1 deletions

View File

@ -2,6 +2,7 @@ $Id: Changelog.txt,v 1.322 2013/01/29 21:52:44 nanard Exp $
2013/01/29:
upnphttp.c: Fix and comment the findendheaders() function
upnphttp.c: remove strchr() call in ParseHttpHeaders()
2013/01/27:
upnphttp.c: ParseHttpHeaders() now checks atoi() return

View File

@ -83,7 +83,16 @@ ParseHttpHeaders(struct upnphttp * h)
/* TODO : check if req_buf, contentoff are ok */
while(line < (h->req_buf + h->req_contentoff))
{
colon = strchr(line, ':');
colon = line;
while(*colon != ':')
{
if(*colon == '\r' || *colon == '\n')
{
colon = NULL; /* no ':' character found on the line */
break;
}
colon++;
}
if(colon)
{
if(strncasecmp(line, "Content-Length", 14)==0)