pgsql: test_saslprep: Fix issue with copy of input bytea

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: test_saslprep: Fix issue with copy of input bytea
Date: 2026-04-13 00:06:53
Message-ID: E1wC4pJ-000i7m-10@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

test_saslprep: Fix issue with copy of input bytea

The data given in input of the function may not be null-terminated,
causing strlcpy() to complain with an invalid read.

Issue spotted using valgrind.

Reported-by: Alexander Lakhin <exclusion(at)gmail(dot)com>
Discussion: https://postgr.es/m/09df9d75-13e7-45fe-89af-33fe118e797b@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5d35531af1840fdd8debfc1ff657643ddba029ab

Modified Files
--------------
src/test/modules/test_saslprep/test_saslprep.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2026-04-13 01:17:21 pgsql: Improve various new-to-v19 appendStringInfo calls
Previous Message David Rowley 2026-04-12 23:40:24 pgsql: Fix unlikely overflow bug in bms_next_member()