Fix overflow of nbatch

From: Vaibhav Jain <jainva(at)google(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Madhukar <madhukarprasad(at)google(dot)com>, Sangeetha Seshadri <sangsesh(at)google(dot)com>
Subject: Fix overflow of nbatch
Date: 2025-09-22 13:20:51
Message-ID: CABa-Az174YvfFq7rLS+VNKaQyg7inA2exvPWmPWqnEn6Ditr_Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Everyone,

With a1b4f28, to compute current_space, nbatch is being multiplied
by BLCKSZ. nbatch is int and when multiplied with BLCKSZ, it can
easily overflow the int limit.To keep the calculation safe for
current_space, convert nbatch to size_t.

Please find a patch for the same.

Thanks,
Vaibhav

Attachment Content-Type Size
0001-Fix-overflow-of-nbatch.patch application/octet-stream 948 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Jones 2025-09-22 13:27:52 Re: We broke the defense against accessing other sessions' temp tables
Previous Message Matheus Alcantara 2025-09-22 13:09:20 Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue