From 830d1373878665320156f0d4263e231bbb425fa8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 3 Feb 2024 16:42:01 +0100 Subject: [PATCH] don't use the output printf buffer as a %s parameter followup for ebcb9eca2929 --- libmariadb/mariadb_lib.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libmariadb/mariadb_lib.c b/libmariadb/mariadb_lib.c index 36219385..c9253ec1 100644 --- a/libmariadb/mariadb_lib.c +++ b/libmariadb/mariadb_lib.c @@ -1808,10 +1808,14 @@ restart: else if (IS_MYSQL_ERROR(code) || IS_MARIADB_ERROR(code)) ; /* not forged - generated on the client side */ else if (mysql->options.use_ssl) + { + char last_error[sizeof(mysql->net.last_error)]; + strcpy(last_error, mysql->net.last_error); my_set_error(mysql, CR_CONNECTION_ERROR, SQLSTATE_UNKNOWN, "Received error packet before completion of TLS handshake. " - "The authenticity of the following error cannot be verified:\n%d - %s", - code, mysql->net.last_error); + "The authenticity of the following error cannot be verified: %d - %s", + code, last_error); + } goto error; }