mirror of
https://github.com/postgres/postgres.git
synced 2026-05-28 04:35:45 -04:00
Assert that wrapper_handler()'s argument is within expected range.
pqsignal() already does a similar check, but strange Valgrind reports have us wondering if wrapper_handler() is somehow getting called 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.me Backpatch-through: 17
This commit is contained in:
parent
5c8dcf9483
commit
c3510cfc8b
1 changed files with 4 additions and 0 deletions
|
|
@ -87,6 +87,9 @@ wrapper_handler(SIGNAL_ARGS)
|
|||
{
|
||||
int save_errno = errno;
|
||||
|
||||
Assert(postgres_signal_arg > 0);
|
||||
Assert(postgres_signal_arg < PG_NSIG);
|
||||
|
||||
#ifndef FRONTEND
|
||||
|
||||
/*
|
||||
|
|
@ -139,6 +142,7 @@ pqsignal(int signo, pqsigfunc func)
|
|||
pqsigfunc ret;
|
||||
#endif
|
||||
|
||||
Assert(signo > 0);
|
||||
Assert(signo < PG_NSIG);
|
||||
|
||||
if (func != SIG_IGN && func != SIG_DFL)
|
||||
|
|
|
|||
Loading…
Reference in a new issue