Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5048068

Browse files
author
Commitfest Bot
committed
[CF 5639] v2 - assert that wrapper_handler()'s argument is within expected range
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5639 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/Z8tZV4zv4uoAFHNa@nathan Author(s): Nathan Bossart
2 parents 34c3c5c + 52c25b1 commit 5048068

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
int save_errno = errno;
8989

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

9295
/*
@@ -123,6 +126,7 @@ pqsignal(int signo, pqsigfunc func)
123126
struct sigaction act;
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)