From 3a87aa2f10bd7f1408e1849bdb59c41dd63a9fe9 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Mon, 9 Dec 2013 09:25:39 +0100 Subject: [PATCH] miniwget.c: fixed potential buffer overrun --- miniupnpc/Changelog.txt | 3 +++ miniupnpc/miniwget.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/miniupnpc/Changelog.txt b/miniupnpc/Changelog.txt index 50b8221..1aded29 100644 --- a/miniupnpc/Changelog.txt +++ b/miniupnpc/Changelog.txt @@ -1,6 +1,9 @@ $Id: Changelog.txt,v 1.187 2013/06/06 21:36:39 nanard Exp $ miniUPnP client Changelog. +2013/10/07: + fixed potential buffer overrun in miniwget.c + 2013/08/01: define MAXHOSTNAMELEN if not already done diff --git a/miniupnpc/miniwget.c b/miniupnpc/miniwget.c index a420d57..a75f55b 100644 --- a/miniupnpc/miniwget.c +++ b/miniupnpc/miniwget.c @@ -162,7 +162,7 @@ getHTTPResponse(int s, int * size) 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++; linestart = i; colon = linestart;