From f7f67359edbba94f2dd9686a5c6beffea2b63aa1 Mon Sep 17 00:00:00 2001 From: Justin Maggard Date: Sun, 3 May 2009 07:15:52 +0000 Subject: [PATCH] * Handle double client detection without getting into an infinite loop. --- upnphttp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/upnphttp.c b/upnphttp.c index 0f18949..7fa5a4b 100644 --- a/upnphttp.c +++ b/upnphttp.c @@ -207,7 +207,7 @@ intervening space) by either an integer or the keyword "infinite". */ { /* Skip client detection if we already detected it. */ if( h->req_client ) - continue; + goto next_header; p = colon + 1; while(isspace(*p)) p++; @@ -233,6 +233,9 @@ intervening space) by either an integer or the keyword "infinite". */ } else if(strncasecmp(line, "X-AV-Client-Info", 16)==0) { + /* Skip client detection if we already detected it. */ + if( h->req_client ) + goto next_header; p = colon + 1; while(isspace(*p)) p++; @@ -291,6 +294,7 @@ intervening space) by either an integer or the keyword "infinite". */ } } } +next_header: while(!(line[0] == '\r' && line[1] == '\n')) line++; line += 2;