File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 2222PDO_API void pdo_handle_error (pdo_dbh_t * dbh , pdo_stmt_t * stmt );
2323
2424#define PDO_DBH_CLEAR_ERR () do { \
25- strlcpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \
25+ ZEND_ASSERT(sizeof(dbh->error_code) == sizeof(PDO_ERR_NONE)); \
26+ memcpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \
2627 if (dbh->query_stmt) { \
2728 dbh->query_stmt = NULL; \
2829 zval_ptr_dtor(&dbh->query_stmt_zval); \
2930 } \
3031} while (0)
31- #define PDO_STMT_CLEAR_ERR () strcpy(stmt->error_code, PDO_ERR_NONE)
32+ #define PDO_STMT_CLEAR_ERR () do { \
33+ ZEND_ASSERT(sizeof(stmt->error_code) == sizeof(PDO_ERR_NONE)); \
34+ memcpy(stmt->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \
35+ } while (0)
3236#define PDO_HANDLE_DBH_ERR () if (strcmp(dbh->error_code, PDO_ERR_NONE)) { pdo_handle_error(dbh, NULL); }
3337#define PDO_HANDLE_STMT_ERR () if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt); }
3438
You can’t perform that action at this time.
0 commit comments