Skip to content

Commit e9e0fe4

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: exp/pgsql: insert/update query string build possible UB fix.
2 parents 7722a9a + 709c2f7 commit e9e0fe4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/pgsql/pgsql.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5663,7 +5663,7 @@ PHP_PGSQL_API zend_result php_pgsql_insert(PGconn *pg_link, const zend_string *t
56635663
goto cleanup;
56645664
}
56655665
if (opt & PGSQL_DML_ESCAPE) {
5666-
tmp = PQescapeIdentifier(pg_link, ZSTR_VAL(fld), ZSTR_LEN(fld) + 1);
5666+
tmp = PQescapeIdentifier(pg_link, ZSTR_VAL(fld), ZSTR_LEN(fld));
56675667
if (tmp == NULL) {
56685668
php_error_docref(NULL, E_NOTICE, "Failed to escape field '%s'", ZSTR_VAL(fld));
56695669
goto cleanup;
@@ -5848,7 +5848,7 @@ static inline int build_assignment_string(PGconn *pg_link, smart_str *querystr,
58485848
return -1;
58495849
}
58505850
if (opt & PGSQL_DML_ESCAPE) {
5851-
char *tmp = PQescapeIdentifier(pg_link, ZSTR_VAL(fld), ZSTR_LEN(fld) + 1);
5851+
char *tmp = PQescapeIdentifier(pg_link, ZSTR_VAL(fld), ZSTR_LEN(fld));
58525852
if (tmp == NULL) {
58535853
php_error_docref(NULL, E_NOTICE, "Failed to escape field '%s'", ZSTR_VAL(fld));
58545854
return -1;

0 commit comments

Comments
 (0)