Avoid out-of-bounds read in errfinish if error_stack_depth < 0.
authorRobert Haas <rhaas@postgresql.org>
Mon, 2 Dec 2013 15:40:33 +0000 (10:40 -0500)
committerRobert Haas <rhaas@postgresql.org>
Mon, 2 Dec 2013 15:42:01 +0000 (10:42 -0500)
commit9d140f7be2836e3baf6c9dc7989dea69ef693532
treed7a7a7412deeb7a445a2390434f32bb77409c598
parent3e3520cf7a70aa85f55a7be37924aaa1809a4be3
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
src/backend/utils/error/elog.c