From 98cf90307ccb24159c6afdc7abe4be904e3d187c Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sat, 28 Jun 2025 12:03:44 +0200 Subject: [PATCH] ext/mysqli: Get rid of calls to strcpy strcpy is a dangerous API that should be avoided. --- ext/mysqli/mysqli_report.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/mysqli/mysqli_report.c b/ext/mysqli/mysqli_report.c index 68a7a57584750..06611310b0b0c 100644 --- a/ext/mysqli/mysqli_report.c +++ b/ext/mysqli/mysqli_report.c @@ -48,12 +48,12 @@ void php_mysqli_report_error(const char *sqlstate, int errorno, const char *erro /* {{{ void php_mysqli_report_index() */ void php_mysqli_report_index(const char *query, unsigned int status) { - char index[15]; + const char *index; if (status & SERVER_QUERY_NO_GOOD_INDEX_USED) { - strcpy(index, "Bad index"); + index = "Bad index"; } else if (status & SERVER_QUERY_NO_INDEX_USED) { - strcpy(index, "No index"); + index = "No index"; } else { return; }