Re: [PATCH] Fix potential overflow in binary search mid calculation

2025-03-31 Thread Tender Wang
Jianghua Yang 于2025年4月1日周二 04:29写道: > Dear PostgreSQL Developers, > > I have identified a potential integer overflow issue in the binary search > implementation within the DSA size class lookup code. > Issue Description > > In the current implementation, the calculation of mid is performed as: >

[PATCH] Fix potential overflow in binary search mid calculation

2025-03-31 Thread Jianghua Yang
Dear PostgreSQL Developers, I have identified a potential integer overflow issue in the binary search implementation within the DSA size class lookup code. Issue Description In the current implementation, the calculation of mid is performed as: uint16 mid = (max + min) / 2; Since both max and m