1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

ext/mysqli: Get rid of calls to strcpy (#18970)

strcpy is a dangerous API that should be avoided.
This commit is contained in:
Niels Dossche
2025-06-28 14:04:39 +02:00
committed by GitHub
parent 737db4a7dc
commit 984bcb5d69

View File

@@ -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;
}