Avoid out-of-bounds read in errfinish if error_stack_depth < 0.

Robert Haas <rhaas@postgresql.org>

Commit: 9d140f7be2836e3baf6c9dc7989dea69ef693532
Author: Robert Haas <rhaas@postgresql.org>
Date: 2013-12-02T15:42:01Z
Releases: 9.4.0
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 the
problem until CHECK_STACK_DEPTH() is invoked.  In the meantime,
elevel will be set based on an invalid read.  This is probably
harmless in practice, but it seems cleaner this way.

Xi Wang

Files

PathChange+/−
src/backend/utils/error/elog.c modified +2 −1