On Sun, Apr 12, 2026 at 09:00:00AM +0300, Alexander Lakhin wrote:
> That is, strlcpy() tries to evaluate strlen() for src, which contains only
> one byte without null terminator.

Thanks for the report.  I don't know why skink is not complaining, but
I do see the failure, and I am able to fix it with the attached.  Does
it work on your side?
--
Michael
diff --git a/src/test/modules/test_saslprep/test_saslprep.c 
b/src/test/modules/test_saslprep/test_saslprep.c
index 70ff7069bf70..121212d4fa21 100644
--- a/src/test/modules/test_saslprep/test_saslprep.c
+++ b/src/test/modules/test_saslprep/test_saslprep.c
@@ -84,7 +84,8 @@ test_saslprep(PG_FUNCTION_ARGS)
         * Copy the input given, to make SASLprep() act on a sanitized string.
         */
        input_data = palloc0(src_len + 1);
-       strlcpy(input_data, src, src_len + 1);
+       memcpy(input_data, src, src_len);
+       input_data[src_len] = '\0';
 
        rc = pg_saslprep(input_data, &result);
        status = saslprep_status_to_text(rc);

Attachment: signature.asc
Description: PGP signature

Reply via email to