pgsql: Fix failure to consider failure cases in GetComboCommandId(). - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix failure to consider failure cases in GetComboCommandId().
Date
Msg-id E1a21CZ-0001Em-Iv@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix failure to consider failure cases in GetComboCommandId().

Failure to initially palloc the comboCids array, or to realloc it bigger
when needed, left combocid's data structures in an inconsistent state that
would cause trouble if the top transaction continues to execute.  Noted
while examining a user complaint about the amount of memory used for this.
(There's not much we can do about that, but it does point up that repalloc
failure has a non-negligible chance of occurring here.)

In HEAD/9.5, also avoid possible invocation of memcpy() with a null pointer
in SerializeComboCIDState; cf commit 13bba0227.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/47e189b5a10fdc5b983d1917e6f641ee80fa500b

Modified Files
--------------
src/backend/utils/time/combocid.c |   38 +++++++++++++++++++------------------
1 file changed, 20 insertions(+), 18 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix failure to consider failure cases in GetComboCommandId().
Next
From: Tom Lane
Date:
Subject: pgsql: Fix failure to consider failure cases in GetComboCommandId().