Remove nonsensical code from odbc_execute() (#18767)

strlen() operates on NUL-terminated strings, writing a NUL byte at the
strlen offset accomplishes nothing but wasting cycles.
This commit is contained in:
Niels Dossche 2025-06-04 23:18:48 +02:00 committed by GitHub
parent 1aae2ad91b
commit 7f91462019
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1068,7 +1068,6 @@ PHP_FUNCTION(odbc_execute)
RETURN_FALSE; RETURN_FALSE;
} }
filename = estrndup(&ZSTR_VAL(tmpstr)[1], ZSTR_LEN(tmpstr) - 2); filename = estrndup(&ZSTR_VAL(tmpstr)[1], ZSTR_LEN(tmpstr) - 2);
filename[strlen(filename)] = '\0';
/* Check the basedir */ /* Check the basedir */
if (php_check_open_basedir(filename)) { if (php_check_open_basedir(filename)) {