8000 http/client: fix possible null pointer dereference by sreimers · Pull Request #509 · baresip/re · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

http/client: fix possible null pointer dereference #509

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

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

sreimers
Copy link
Member
@sreimers sreimers commented Sep 6, 2022

Reported-by: Coverity Scan

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)

** CID 277673:  Null pointer dereferences  (REVERSE_INULL)
/src/http/client.c: 396 in send_req_buf()
________________________________________________________________________________________________________
*** CID 277673:  Null pointer dereferences  (REVERSE_INULL)
/src/http/client.c: 396 in send_req_buf()
390     
391     static int send_req_buf(struct conn *conn)
392     {
393     	int err;
394     	struct http_req *req = conn->req;
395     
>>>     CID 277673:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "conn" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
396     	if (!conn || !req || !req->cli)
397     		return EINVAL;
398     
399     	if (!mbuf_get_left(req->mbreq))
400     		return 0;
401     

9073

@sreimers sreimers merged commit 6fcc1c1 into main Sep 6, 2022
@sreimers sreimers deleted the http_client_coverity branch September 6, 2022 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0