-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix potential Null pointer dereference in regress_ws.c #1621
Conversation
I'm not sure if I should close |
Yes, it should be done under |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
test/regress_ws.c
Outdated
@@ -388,4 +390,5 @@ http_ws_test(void *arg) | |||
end: | |||
if (bev) | |||
bufferevent_free(bev); | |||
EVUTIL_CLOSESOCKET(fd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (fd != EVUTIL_INVALID_SOCKET)
(and use it for initilzation), and also let's add a check for http
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the http
is not used here? I'm not quite sure where I'm supposed to add the check.
Additionally, I should initialize fd to EVUTIL_INVALID_SOCKET
and check if it is EVUTIL_INVALID_SOCKET
before closing, is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the http is not used here?
It is used it creates http server, see usage of port
.
I'm not quite sure where I'm supposed to add the check.
The http
initialization may fail, so - if (!http) goto err
Additionally, I should initialize fd to EVUTIL_INVALID_SOCKET and check if it is EVUTIL_INVALID_SOCKET before closing, is that right?
Yes
76be7f0
to
a2eff65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/home/runner/work/libevent/libevent/test/regress_ws.c:351:2: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
351 | struct evbuffer *out;
| ^~~~~~
There seems to be a lot of failures with:
Could those failures be related to those changes (more specifically, the |
1e053b7
to
a0fd689
Compare
Please resubmit |
Fix #1604