Skip to content

Commit 3581c77

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fix null handling in mysqli_begin_transaction()
2 parents 40e920e + d66e929 commit 3581c77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/mysqli/mysqli_nonapi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ PHP_FUNCTION(mysqli_begin_transaction)
11601160
zval *mysql_link;
11611161
zend_long flags = TRANS_START_NO_OPT;
11621162
char * name = NULL;
1163-
size_t name_len = -1;
1163+
size_t name_len = 0;
11641164

11651165
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ls!", &mysql_link, mysqli_link_class_entry, &flags, &name, &name_len) == FAILURE) {
11661166
RETURN_THROWS();
@@ -1170,7 +1170,7 @@ PHP_FUNCTION(mysqli_begin_transaction)
11701170
zend_argument_value_error(ERROR_ARG_POS(2), "must be one of the MYSQLI_TRANS_* constants");
11711171
RETURN_THROWS();
11721172
}
1173-
if (!name_len) {
1173+
if (name && !name_len) {
11741174
zend_argument_value_error(ERROR_ARG_POS(3), "cannot be empty");
11751175
RETURN_THROWS();
11761176
}

0 commit comments

Comments
 (0)