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

Commit9d140f7

Browse files
committed
Avoid out-of-bounds read in errfinish if error_stack_depth < 0.
If errordata_stack_depth < 0, we won't find that out and correct theproblem until CHECK_STACK_DEPTH() is invoked. In the meantime,elevel will be set based on an invalid read. This is probablyharmless in practice, but it seems cleaner this way.Xi Wang
1 parent3e3520c commit9d140f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/utils/error/elog.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,12 +397,13 @@ void
397397
errfinish(intdummy,...)
398398
{
399399
ErrorData*edata=&errordata[errordata_stack_depth];
400-
intelevel=edata->elevel;
400+
intelevel;
401401
MemoryContextoldcontext;
402402
ErrorContextCallback*econtext;
403403

404404
recursion_depth++;
405405
CHECK_STACK_DEPTH();
406+
elevel=edata->elevel;
406407

407408
/*
408409
* Do processing in ErrorContext, which we hope has enough reserved space

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp