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

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

View File

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