Skip to content

Commit 984bcb5

Browse files
authored
ext/mysqli: Get rid of calls to strcpy (#18970)
strcpy is a dangerous API that should be avoided.
1 parent 737db4a commit 984bcb5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/mysqli/mysqli_report.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ void php_mysqli_report_error(const char *sqlstate, int errorno, const char *erro
4848

4949
/* {{{ void php_mysqli_report_index() */
5050
void php_mysqli_report_index(const char *query, unsigned int status) {
51-
char index[15];
51+
const char *index;
5252

5353
if (status & SERVER_QUERY_NO_GOOD_INDEX_USED) {
54-
strcpy(index, "Bad index");
54+
index = "Bad index";
5555
} else if (status & SERVER_QUERY_NO_INDEX_USED) {
56-
strcpy(index, "No index");
56+
index = "No index";
5757
} else {
5858
return;
5959
}

0 commit comments

Comments
 (0)