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

Commit088f8e2

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 parent34c3c5c commit088f8e2

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
/*
@@ -123,6 +126,7 @@ pqsignal(int signo, pqsigfunc func)
123126
structsigactionact;
124127
#endif
125128

129+
Assert(signo>0);
126130
Assert(signo<PG_NSIG);
127131

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp