summaryrefslogtreecommitdiff
path: root/ext/standard/dir.c
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-09-01 09:38:19 +0000
committerSascha Schumann <sas@php.net>2000-09-01 09:38:19 +0000
commitd60799bf6b5e79fc43054c07f6ba3cddbdaa1066 (patch)
tree28da25620b0a0c504681793665a8e34d04e12d2c /ext/standard/dir.c
parentfd49c6ff057dc79a81db380f611142f75c32f3d0 (diff)
downloadphp-git-d60799bf6b5e79fc43054c07f6ba3cddbdaa1066.tar.gz
Solaris/x86 insists of having a large buffer for storing the result of
readdir_r(), otherwise it will segfault. PR: #6479
Diffstat (limited to 'ext/standard/dir.c')
-rw-r--r--ext/standard/dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 32674b696f..3ba53c67ab 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -289,13 +289,13 @@ PHP_FUNCTION(readdir)
{
pval **id, **tmp, *myself;
php_dir *dirp;
- struct dirent entry;
+ char entry[sizeof(struct dirent) + PATH_MAX + 1];
struct dirent *result;
DIRLS_FETCH();
FETCH_DIRP();
- if (php_readdir_r(dirp->dir, &entry, &result) == 0 && result) {
+ if (php_readdir_r(dirp->dir, (struct dirent *) entry, &result) == 0 && result) {
RETURN_STRINGL(result->d_name, strlen(result->d_name), 1);
}
RETURN_FALSE;