Skip to content

Commit 7f91462

Browse files
authored
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.
1 parent 1aae2ad commit 7f91462

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

ext/odbc/php_odbc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,6 @@ PHP_FUNCTION(odbc_execute)
10681068
RETURN_FALSE;
10691069
}
10701070
filename = estrndup(&ZSTR_VAL(tmpstr)[1], ZSTR_LEN(tmpstr) - 2);
1071-
filename[strlen(filename)] = '\0';
10721071

10731072
/* Check the basedir */
10741073
if (php_check_open_basedir(filename)) {

0 commit comments

Comments
 (0)