Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcd1c8b9

Browse files
committed
Avoid low-probability crash on out-of-memory.
check_restrict_nonsystem_relation_kind() correctly uses guc_malloc()in v16 and later. But in older branches it must use malloc()directly, and it forgot to check for failure return.Faulty backpatching of66e9444.Karina LitskevichDiscussion:https://postgr.es/m/CACiT8iZ=atkguKVbpN4HmJFMb4+T9yEowF5JuPZG8W+kkZ9L6w@mail.gmail.com
1 parent1168acb commitcd1c8b9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎src/backend/tcop/postgres.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3489,6 +3489,11 @@ check_restrict_nonsystem_relation_kind(char **newval, void **extra, GucSource so
34893489

34903490
/* Save the flags in *extra, for use by the assign function */
34913491
*extra=malloc(sizeof(int));
3492+
if (*extra==NULL)
3493+
ereport(ERROR,
3494+
(errcode(ERRCODE_OUT_OF_MEMORY),
3495+
errmsg("out of memory")));
3496+
34923497
*((int*)*extra)=flags;
34933498

34943499
return true;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp