Skip to content

Commit 1d82b6f

Browse files
authored
sapi/phpdbg: restore the DEFAULT_SLASH check on the module path (#23583)
The move to memchr() in GH-21578 changed: `if (strchr(*path, '/') != NULL || strchr(*path, DEFAULT_SLASH) != NULL) {` to `if (memchr(ZSTR_VAL(*path), '/', ZSTR_LEN(*path)) != NULL || memchr(ZSTR_VAL(*path), '/', ZSTR_LEN(*path)) != NULL) {` instead of `if (memchr(ZSTR_VAL(*path), '/', ZSTR_LEN(*path)) != NULL || memchr(ZSTR_VAL(*path), DEFAULT_SLASH, ZSTR_LEN(*path)) != NULL) {` Fix this.
1 parent d1116a1 commit 1d82b6f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sapi/phpdbg/phpdbg_prompt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ static const char *phpdbg_load_module_or_extension(zend_string **path, const cha
11921192
phpdbg_error("extension_dir ini setting contains a nul byte");
11931193
return NULL;
11941194
}
1195-
if (memchr(ZSTR_VAL(*path), '/', ZSTR_LEN(*path)) != NULL || memchr(ZSTR_VAL(*path), '/', ZSTR_LEN(*path)) != NULL) {
1195+
if (memchr(ZSTR_VAL(*path), '/', ZSTR_LEN(*path)) != NULL || memchr(ZSTR_VAL(*path), DEFAULT_SLASH, ZSTR_LEN(*path)) != NULL) {
11961196
/* path is fine */
11971197
} else if (extension_dir && ZSTR_LEN(extension_dir) > 0) {
11981198
zend_string *libpath;

0 commit comments

Comments
 (0)