Re: Possible integer overflow in bringetbitmap()
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: James Hunter <james.hunter.pg@gmail.com>
Cc: Evgeniy Gorbanyov <gorbanyoves@basealt.ru>, pgsql-hackers@lists.postgresql.org
Date: 2024-12-05T06:13:14Z
Lists: pgsql-hackers
On Wed, Dec 04, 2024 at 02:05:10PM -0800, James Hunter wrote: > So, I think your patch should be, instead, to cast either "totalpages" > or "10" to "int64", in the return statement. totalpages is signed, and BlockNumber is unsigned. Hence in theory you could always fall into a trap once totalpages gets higher than (2^31 - 1), no? This is not going to be a problem in practice even if the number of pages per range assigned to brin can be 1, still.. -- Michael
Commits
-
Fix potential integer overflow in bringetbitmap()
- 332023e2d032 13.19 landed
- e35ff6520569 14.16 landed
- 9e9f30139eb8 15.11 landed
- bfda7d8dd6b3 16.7 landed
- e027ee9902fa 17.3 landed
- 720e529840d5 18.0 landed