From 6d81a545ffb7596dc952577e5db223a690f8d096 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 4 Jun 2025 22:37:23 +0200 Subject: [PATCH] Remove nonsensical code from odbc_execute() strlen() operates on NUL-terminated strings, writing a NUL byte at the strlen offset accomplishes nothing but wasting cycles. --- ext/odbc/php_odbc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 4017c72a35a67..2eb994cad3d5e 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -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)) {