Fix possible "invalid memory alloc request size" failure in nodeHash.c.
authorTom Lane
Sun, 4 Oct 2015 18:16:59 +0000 (14:16 -0400)
committerTom Lane
Sun, 4 Oct 2015 18:16:59 +0000 (14:16 -0400)
commitff4cbc1ff3d23fe9c40110c8953e0d07457b136b
treea68f4ec8e20961ce1d9f47cbac3d30704a7a9fd8
parent99557984bc91446d50a70fc5ecb1306bc3cf56f6
Fix possible "invalid memory alloc request size" failure in nodeHash.c.

Limit the size of the hashtable pointer array to not more than
MaxAllocSize.  We've seen reports of failures due to this in HEAD/9.5,
and it seems possible in older branches as well.  The change in
NTUP_PER_BUCKET in 9.5 may have made the problem more likely, but
surely it didn't introduce it.

Tomas Vondra, slightly modified by me
src/backend/executor/nodeHash.c