pgsql: Fix overflow in bsearch_arg() with more than INT_MAX elements

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix overflow in bsearch_arg() with more than INT_MAX elements
Date: 2024-10-28 12:13:20
Message-ID: E1t5Ocb-002q7V-2u@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix overflow in bsearch_arg() with more than INT_MAX elements

This was introduced in commit bfa2cee784, which replaced the old
bsearch_cmp() function we had in extended_stats.c with the current
implementation. The original discussion or commit message of
bfa2cee784 didn't mention where the new implementation came from, but
based on some googling, I'm guessing *BSD or libiberty, all of which
share this same code, with or without this fix.

Author: Ranier Vilela
Reviewed-by: Nathan Bossart
Backpatch-through: 14
Discussion: https://www.postgresql.org/message-id/CAEudQAp34o_8u6sGSVraLwuMv9F7T9hyHpePXHmRaxR2Aboi%2Bw%40mail.gmail.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/55327256a049e3926d4d1cda39a7bb5886cbe03c

Modified Files
--------------
src/port/bsearch_arg.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2024-10-28 15:47:19 Re: pgsql: Implement pg_wal_replay_wait() stored procedure
Previous Message Heikki Linnakangas 2024-10-28 11:26:47 pgsql: Restore missing line to copyright notice