Possible integer overflow in bringetbitmap()

Evgeniy Gorbanev <gorbanyoves@basealt.ru>

From: Evgeniy Gorbanyov <gorbanyoves@basealt.ru>
To: pgsql-hackers@lists.postgresql.org
Date: 2024-11-26T10:56:50Z
Lists: pgsql-hackers

Attachments

Hello.

Function bringetbitmap() in src/backend/access/brin/brin.c:560 returns 
type int64. But the returned variable 'totalpages' is of type int. Maybe 
it makes sense to change the type of variable 'totalpages' to int64 to 
avoid possible overflow in expression 'totalpages * 10'?

Patch is included in the attachment.


Best regards,

Evgeniy Gorbanyov

Commits

  1. Fix potential integer overflow in bringetbitmap()