mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Fix a couple of signed/unsigned warnings in http.c
This commit is contained in:
parent
c11c6fcd82
commit
203ba2742f
4
http.c
4
http.c
@ -881,7 +881,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;
|
||||
}
|
||||
|
||||
@ -907,7 +907,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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user