aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-12-11 22:09:20 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2012-12-11 22:09:20 -0500
commitf0fc1d4c890135ec879860f7d0c49b34d492d99f (patch)
tree583c9bf139c93b1f64abf59b7ed9790ce3d68e10 /src/backend/access/gist
parent97a60fa5a06bf60c857976e24ef2ed0cb882cd52 (diff)
downloadpostgresql-f0fc1d4c890135ec879860f7d0c49b34d492d99f.tar.gz
postgresql-f0fc1d4c890135ec879860f7d0c49b34d492d99f.zip
Add defenses against integer overflow in dynahash numbuckets calculations.
The dynahash code requires the number of buckets in a hash table to fit in an int; but since we calculate the desired hash table size dynamically, there are various scenarios where we might calculate too large a value. The resulting overflow can lead to infinite loops, division-by-zero crashes, etc. I (tgl) had previously installed some defenses against that in commit 299d1716525c659f0e02840e31fbe4dea3, but that covered only one call path. Moreover it worked by limiting the request size to work_mem, but in a 64-bit machine it's possible to set work_mem high enough that the problem appears anyway. So let's fix the problem at the root by installing limits in the dynahash.c functions themselves. Trouble report and patch by Jeff Davis.
Diffstat (limited to 'src/backend/access/gist')
0 files changed, 0 insertions, 0 deletions