Skip to content
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

Possible derefence of null pointer #1212

Closed
Bbulatov opened this issue Nov 28, 2024 · 1 comment · Fixed by #1241
Closed

Possible derefence of null pointer #1212

Bbulatov opened this issue Nov 28, 2024 · 1 comment · Fixed by #1241

Comments

@Bbulatov
Copy link

Bbulatov commented Nov 28, 2024

Hello!
During the static analysis was found possible mistake in code:

  1. Return value of a function 'pktbuf_dynamic' (client.c:990) is dereferenced at client.c:993 without checking for NULL, but it is usually checked for this function
    изображение
    Please clarify whether verification is required in this case? Do you need to make any changes/corrections to the code?
eulerto added a commit to eulerto/pgbouncer that referenced this issue Dec 4, 2024
The commit 6a39179 introduces
NegotiateProtocolVersion message but forgot to check the memory
allocation success.

Fixes pgbouncer#1212.
@eulerto
Copy link
Member

eulerto commented Dec 4, 2024

Good catch! That's an oversight in the commit 6a39179.

@JelteF While inspecting this code path, I think you forgot a return false into the if (!res) block.

JelteF added a commit to JelteF/pgbouncer that referenced this issue Jan 7, 2025
@JelteF JelteF closed this as completed in 087a6b6 Jan 9, 2025
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 a pull request may close this issue.

2 participants