Detect, log and avoid storing a request with a negative size.

This commit is contained in:
Yang Tse 2007-10-26 00:36:36 +00:00
parent faaaf62655
commit 1d49c04545

View File

@ -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");