Fix possible "invalid memory alloc request size" failure in nodeHash.c.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: fd3e3cf500de7f8f625744fbd8a413b27f500abe
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2015-10-04T18:17:20Z
Releases: 9.2.14
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

Files

PathChange+/−
src/backend/executor/nodeHash.c modified +4 −2