Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2016-10-14 20:28:34 +0000
committerTom Lane2016-10-14 20:28:34 +0000
commit32fdf42cf546f613aab9ca98935c40a046187fa9 (patch)
treecbd28308b7dccde202b73aa785b11be793ec1595 /contrib/btree_gist
parent13d3180fd14c624bbb274e200e98ddb50e260216 (diff)
Fix assorted integer-overflow hazards in varbit.c.
bitshiftright() and bitshiftleft() would recursively call each other infinitely if the user passed INT_MIN for the shift amount, due to integer overflow in negating the shift amount. To fix, clamp to -VARBITMAXLEN. That doesn't change the results since any shift distance larger than the input bit string's length produces an all-zeroes result. Also fix some places that seemed inadequately paranoid about input typmods exceeding VARBITMAXLEN. While a typmod accepted by anybit_typmodin() will certainly be much less than that, at least some of these spots are reachable with user-chosen integer values. Andreas Seltenreich and Tom Lane Discussion: <87d1j2zqtz.fsf@credativ.de>
Diffstat (limited to 'contrib/btree_gist')
0 files changed, 0 insertions, 0 deletions