From: Yang Tse Date: Fri, 26 Oct 2007 00:36:36 +0000 (+0000) Subject: Detect, log and avoid storing a request with a negative size. X-Git-Tag: curl-7_17_1~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d49c04545ae297647ac96cbf3b3acd79c100217;p=curl Detect, log and avoid storing a request with a negative size. --- diff --git a/tests/server/sws.c b/tests/server/sws.c index 55c05b199..5598328cc 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -468,6 +468,11 @@ void storerequest(char *reqbuf, ssize_t totalsize) if (totalsize == 0) return; + else if (totalsize < 0) { + logmsg("Invalid size (%d bytes) for request input. Not written to %s", + totalsize, REQUEST_DUMP); + return; + } do { dump = fopen(REQUEST_DUMP, "ab");