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

Commitc3510cf

Browse files
Assert that wrapper_handler()'s argument is within expected range.
pqsignal() already does a similar check, but strange Valgrindreports have us wondering if wrapper_handler() is somehow gettingcalled with an invalid signal number.Reported-by: Tomas Vondra <tomas@vondra.me>Suggested-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/ace01111-f9ac-4f61-b1b1-8e9379415444%40vondra.meBackpatch-through: 17
1 parent5c8dcf9 commitc3510cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎src/port/pqsignal.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ wrapper_handler(SIGNAL_ARGS)
8787
{
8888
intsave_errno=errno;
8989

90+
Assert(postgres_signal_arg>0);
91+
Assert(postgres_signal_arg<PG_NSIG);
92+
9093
#ifndefFRONTEND
9194

9295
/*
@@ -139,6 +142,7 @@ pqsignal(int signo, pqsigfunc func)
139142
pqsigfuncret;
140143
#endif
141144

145+
Assert(signo>0);
142146
Assert(signo<PG_NSIG);
143147

144148
if (func!=SIG_IGN&&func!=SIG_DFL)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp