Skip to content

Commit bfffb28

Browse files
committed
Not an issue here, but a good habit to follow consistently. Never use strcpy/strcat.
1 parent 97bc4c8 commit bfffb28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/pdo/php_pdo_int.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ extern pdo_driver_t *pdo_find_driver(const char *name, int namelen);
5858
extern void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC);
5959

6060
#define PDO_DBH_CLEAR_ERR() do { \
61-
strcpy(dbh->error_code, PDO_ERR_NONE); \
61+
strncpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \
6262
if (dbh->query_stmt) { \
6363
dbh->query_stmt = NULL; \
6464
zend_objects_store_del_ref(&dbh->query_stmt_zval TSRMLS_CC); \

0 commit comments

Comments
 (0)