mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Fix possible nullptr dereference in evhttp_send_reply_end()
(The existing implementation had sanity-checking code for the case where its argument was NULL, but it erroneously dereferenced it before actually doing the sanity-check. --nickm)
This commit is contained in:
parent
17a8e2d72b
commit
29b2e233a7
4
http.c
4
http.c
@ -2145,13 +2145,15 @@ void
|
|||||||
evhttp_send_reply_end(struct evhttp_request *req)
|
evhttp_send_reply_end(struct evhttp_request *req)
|
||||||
{
|
{
|
||||||
struct evhttp_connection *evcon = req->evcon;
|
struct evhttp_connection *evcon = req->evcon;
|
||||||
struct evbuffer *output = bufferevent_get_output(evcon->bufev);
|
struct evbuffer *output;
|
||||||
|
|
||||||
if (evcon == NULL) {
|
if (evcon == NULL) {
|
||||||
evhttp_request_free(req);
|
evhttp_request_free(req);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output = bufferevent_get_output(evcon->bufev);
|
||||||
|
|
||||||
/* we expect no more calls form the user on this request */
|
/* we expect no more calls form the user on this request */
|
||||||
req->userdone = 1;
|
req->userdone = 1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user