Skip to content

Handle null from add_global_user#1202

Merged
JelteF merged 19 commits into
pgbouncer:masterfrom
greg-rychlewski:fix1111-v1
Dec 2, 2024
Merged

Handle null from add_global_user#1202
JelteF merged 19 commits into
pgbouncer:masterfrom
greg-rychlewski:fix1111-v1

Conversation

@greg-rychlewski
Copy link
Copy Markdown
Contributor

@greg-rychlewski greg-rychlewski commented Nov 3, 2024

Closes #1111
Closes #1112

I had an interest in closing this one out. The original author has mentioned they don't have the time anymore.

I kept all the commits from the old PR and just added one last commit to address the last comment here: #1112 (comment)

I also renamed create_new_global_user to add_new_global_user to be more in line with the naming of find_or_add_new_global_user.

@JelteF Hope it's alright with you. If you had other plans for the old PR please let me know and I can close this one.

dmitry-lipetsk and others added 18 commits July 8, 2024 22:27
It replaces find_global_user or add_global_user.

Also, we check result of find_exist_or_add_new_global_user.

See pgbouncer#1111.
It replaces calls of find_global_credentials+add_global_credentials.

Also, we check a result of find_exist_or_add_new_global_credentials if it needs.

See pgbouncer#1111.

NOTE: add_global_credentials is not used now.
Comment was corrected. Thanks to  JelteF.

Co-authored-by: Jelte Fennema-Nio <github-tech@jeltef.nl>
Comment was corrected. Thanks to JelteF.

Co-authored-by: Jelte Fennema-Nio <github-tech@jeltef.nl>
Comment was corrected. Thanks to  JelteF.

Co-authored-by: Jelte Fennema-Nio <github-tech@jeltef.nl>
create_new_global_user inits user->pool_list, not user->credentials.pool_list
Thanks to JelteF for this recommendation.
@greg-rychlewski greg-rychlewski changed the title Handle null from add_global_user + refactorings Handle null from add_global_user Nov 3, 2024
@JelteF JelteF merged commit 1275e3c into pgbouncer:master Dec 2, 2024
@greg-rychlewski greg-rychlewski deleted the fix1111-v1 branch December 3, 2024 04:24
rajaryanece pushed a commit to rajaryanece/pgbouncer that referenced this pull request Jan 16, 2025
This fixes a bunch of possible null dereferences in case of
malloc returning NULL, i.e. when we're running out of
memory. It's heavily based on pgbouncer#1112

Closes pgbouncer#1111
Closes pgbouncer#1112

Co-authored-by: Dmitry Kovalenko <dmitry.lipetsk@gmail.com>
Co-authored-by: Jelte Fennema-Nio <github-tech@jeltef.nl>
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.

add_global_user and add_global_credentials can return NULL

3 participants