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

ext/sqlite: Sqlite3Stmt::bindParam/bindValue named parameters change. (#14393)

memmove seems unnecessary on `:` autoprepend.
This commit is contained in:
David CARLIER
2024-05-31 21:34:37 +01:00
committed by GitHub
parent 62cdaac280
commit 47c41d4a0f

View File

@@ -1656,7 +1656,7 @@ static int register_bound_parameter_to_sqlite(struct php_sqlite3_bound_param *pa
/* pre-increment for character + 1 for null */
zend_string *temp = zend_string_alloc(ZSTR_LEN(param->name) + 1, 0);
ZSTR_VAL(temp)[0] = ':';
memmove(ZSTR_VAL(temp) + 1, ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1);
memcpy(ZSTR_VAL(temp) + 1, ZSTR_VAL(param->name), ZSTR_LEN(param->name) + 1);
param->name = temp;
} else {
param->name = zend_string_copy(param->name);