You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-03 00:26:59 +02:00
Fix potential buffer overrun in error message handling.
Reported by Lætitia.
This commit is contained in:
@ -122,7 +122,10 @@ testRun()
|
||||
assert(errorTryDepth() == 4);
|
||||
tryDone = true;
|
||||
|
||||
THROW(AssertError, BOGUS_STR);
|
||||
char bigMessage[sizeof(messageBuffer) * 32];
|
||||
memset(bigMessage, 'A', sizeof(bigMessage));
|
||||
|
||||
THROW(AssertError, bigMessage);
|
||||
}
|
||||
TRY_END();
|
||||
}
|
||||
@ -151,6 +154,7 @@ testRun()
|
||||
{
|
||||
assert(errorTryDepth() == 1);
|
||||
assert(errorContext.tryList[1].state == errorStateCatch);
|
||||
assert(strlen(errorMessage()) == sizeof(messageBuffer) - 1);
|
||||
|
||||
catchDone = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user