diff options
author | Yang Tse <yangsita@gmail.com> | 2007-10-26 00:36:36 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2007-10-26 00:36:36 +0000 |
commit | 1d49c04545ae297647ac96cbf3b3acd79c100217 (patch) | |
tree | b660d3bbd0aa108ca26d38ac869f6f25c052ba6c /tests | |
parent | faaaf626551f540e578dad18cab4efbfded38937 (diff) |
Detect, log and avoid storing a request with a negative size.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/server/sws.c | 5 |
1 files changed, 5 insertions, 0 deletions
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"); |