Adding the high and low limits might cause the classic binary
search overflow bug. Probably not a concern but its one less
thing to worry about.
CLA: trivial
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
MergeDate: Fri Mar 13 08:35:30 2026
(Merged from https://github.com/openssl/openssl/pull/30342)
l = 0;
h = num;
while (l < h) {
- i = (l + h) / 2;
+ i = l + (h - l) / 2;
p = &(base_[i * size]);
if (cmp_thunk != NULL)
c = cmp_thunk((cmpthunk_fn)cmp, key, (const void *)p);