diff --git a/http.c b/http.c index aa951e91..540c21d0 100644 --- a/http.c +++ b/http.c @@ -882,7 +882,7 @@ evhttp_handle_chunked_read(struct evhttp_request *req, struct evbuffer *buf) } /* ntoread is signed int64, body_size is unsigned size_t, check for under/overflow conditions */ - if (ntoread > EV_SIZE_MAX - req->body_size) { + if ((ev_uint64_t)ntoread > EV_SIZE_MAX - req->body_size) { return DATA_CORRUPTED; } @@ -908,7 +908,7 @@ evhttp_handle_chunked_read(struct evhttp_request *req, struct evbuffer *buf) } /* don't have enough to complete a chunk; wait for more */ - if (buflen < req->ntoread) + if (req->ntoread > 0 && buflen < (ev_uint64_t)req->ntoread) return (MORE_DATA_EXPECTED); /* Completed chunk */ diff --git a/test/regress.c b/test/regress.c index 5d408dc9..96bc8c84 100644 --- a/test/regress.c +++ b/test/regress.c @@ -2218,6 +2218,7 @@ test_many_events(void *arg) int called[MANY]; int i; int loopflags = EVLOOP_NONBLOCK, evflags=0; + const int is_evport = !strcmp(event_base_get_method(base),"evport"); if (one_at_a_time) { loopflags |= EVLOOP_ONCE; evflags = EV_PERSIST; @@ -2226,6 +2227,10 @@ test_many_events(void *arg) memset(sock, 0xff, sizeof(sock)); memset(ev, 0, sizeof(ev)); memset(called, 0, sizeof(called)); + if (is_evport && one_at_a_time) { + TT_DECLARE("NOTE", ("evport can't pass this in 2.0; skipping\n")); + tt_skip(); + } for (i = 0; i < MANY; ++i) { /* We need an event that will hit the backend, and that will