-
Notifications
You must be signed in to change notification settings - Fork 779
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
TS-4583: Null-pointer dereference after check #802
Conversation
[approve ci] |
Linux build failed! See https://ci.trafficserver.apache.org/job/Github-Linux/334/ for details. |
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/440/ for details. |
I don't think this change is correct. It seems to me that the invariant is that |
@alhonen Thoughts on the concerns from James? |
If they indeed do go NULL together (a bit hard to verify), then we can change the null check instead. I'll modify it thus. |
Fixes Coverity issue CID 1021958: HttpSM.cc checks server_entry against NULL, suggesting it might be NULL, before calling release_server_session(), which dereferences server_entry. As server_session would be NULL along with server_entry, change to only call release_server_session if server_entry is non-NULL.
FreeBSD build successful! See https://ci.trafficserver.apache.org/job/Github-FreeBSD/479/ for details. |
Linux build successful! See https://ci.trafficserver.apache.org/job/Github-Linux/376/ for details. |
It is correct to check the value of the server_entry is not NULL before dereferencing the pointer in the same conditional. This is a common pattern. The method release_server_session dereferences dereference server_entry, so it is most likely stopped by the servers_session NULL pointer check before the dereference. This is more of a side effect and shouldn't be relied on. |
proxy.config.http.push_method_enabled. This adds back the enforcemenent of this configuration so that hosts can only PUSH when proxy.config.http.push_method_enabled is 1. (cherry picked from commit f725f3fd2e66da4a3e6236419bdd8e454c1a8917)
proxy.config.http.push_method_enabled. This adds back the enforcemenent of this configuration so that hosts can only PUSH when proxy.config.http.push_method_enabled is 1. (cherry picked from commit f725f3fd2e66da4a3e6236419bdd8e454c1a8917)
Fixes Coverity issue CID 1021958: HttpSM.cc checks server_entry against
NULL, suggesting it might be NULL, before calling
release_server_session(), which dereferences server_entry.