8000 Fix #65069: GlobIterator fails to access files inside an open_basedir restricted dir by bukka · Pull Request #398 · php/php-src · GitHub
[go: up one dir, main page]

Skip to content

Fix #65069: GlobIterator fails to access files inside an open_basedir restricted dir #398

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use type size_t for open_basedir_indexmap
  • Loading branch information
bukka committed Jul 31, 2013
commit 09cd62aafebce829af71f12c3086f9ec716bf7cf
4 changes: 2 additions & 2 deletions main/streams/glob_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef struct {
size_t path_len;
char *pattern;
size_t pattern_len;
int *open_basedir_indexmap;
size_t *open_basedir_indexmap;
size_t open_basedir_indexmap_size;
} glob_s_t;

Expand Down Expand Up @@ -250,7 +250,7 @@ static php_stream *php_glob_stream_opener(php_stream_wrapper *wrapper, char *pat
for (i = 0; i < pglob->glob.gl_pathc; i++) {
if (!php_check_open_basedir_ex(pglob->glob.gl_pathv[i], 0 TSRMLS_CC)) {
if (!pglob->open_basedir_indexmap)
pglob->open_basedir_indexmap = (int *) emalloc(sizeof(int) * pglob->glob.gl_pathc);
pglob->open_basedir_indexmap = (size_t *) emalloc(sizeof(int) * pglob->glob.gl_pathc);
pglob->open_basedir_indexmap[pglob->open_basedir_indexmap_size++] = i;
}
}
Expand Down
0