Possible integer overflow in bringetbitmap()

From: Evgeniy Gorbanyov <gorbanyoves(at)basealt(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Possible integer overflow in bringetbitmap()
Date: 2024-11-26 10:56:50
Message-ID: 07704817-6fa0-460c-b1cf-cd18f7647041@basealt.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
Possible-integer-overflow-in-bringetbitmap.patch text/x-patch 456 bytes

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2024-11-26 11:40:39 Re: [PATCH] Missing Assert in the code
Previous Message Amit Kapila 2024-11-26 10:52:23 Re: Improve the error message for logical replication of regular column to generated column.