]> granicus.if.org Git - libevent/commitdiff
Fix a signed/unsigned comparison in the last commit
authorNick Mathewson <nickm@torproject.org>
Tue, 7 Dec 2010 16:45:14 +0000 (11:45 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 7 Dec 2010 16:45:14 +0000 (11:45 -0500)
http.c

diff --git a/http.c b/http.c
index 70de30ac1163bfdb2167422ca2d87513868c34df..f56d63685cb5f1a9abe2298a56967c7eb2e071f7 100644 (file)
--- a/http.c
+++ b/http.c
@@ -1846,7 +1846,8 @@ evhttp_get_body(struct evhttp_connection *evcon, struct evhttp_request *req)
                                   no, we should respond with an error. For
                                   now, just optimistically tell the client to
                                   send their message body. */
-                               if (req->ntoread > req->evcon->max_body_size) {
+                               if (req->ntoread > 0 &&
+                                   (size_t)req->ntoread > req->evcon->max_body_size) {
                                        evhttp_send_error(req, HTTP_ENTITYTOOLARGE,
                                                          NULL);
                                        return;