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

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid out-of-bounds read in errfinish if error_stack_depth < 0.
Date: 2013-12-02 15:44:13
Message-ID: E1VnVfR-00076w-La@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9d140f7be2836e3baf6c9dc7989dea69ef693532

Modified Files
--------------
src/backend/utils/error/elog.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2013-12-02 15:52:57 pgsql: Make NUM_TOCHAR_prepare and NUM_TOCHAR_finish macros declare "le
Previous Message Peter Eisentraut 2013-12-02 05:18:11 pgsql: Translation updates