pgsql: Make fallback MD5 implementation thread-safe on big-endian syste

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Make fallback MD5 implementation thread-safe on big-endian syste
Date: 2024-08-07 07:51:31
Message-ID: E1sbbSF-0035LA-7c@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Make fallback MD5 implementation thread-safe on big-endian systems

Replace a static scratch buffer with a local variable, because a
static buffer makes the function not thread-safe. This function is
used in client-code in libpq, so it needs to be thread-safe. It was
until commit b67b57a966, which replaced the implementation with the
one from pgcrypto.

Backpatch to v14, where we switched to the new implementation.

Reviewed-by: Robert Haas, Michael Paquier
Discussion: https://www.postgresql.org/message-id/dfa2015d-ad21-4802-a4cc-3850fc5fff3f@iki.fi

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ffac8ac48e409bbc7c2d9a4b37a1c39908ca24eb

Modified Files
--------------
src/common/md5.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alexander Korotkov 2024-08-07 08:52:13 Re: pgsql: Introduce hash_search_with_hash_value() function
Previous Message Peter Eisentraut 2024-08-07 07:28:40 pgsql: Revert ECPG's use of pnstrdup()