From 7a54e0b10c953339d32e8a9379e6888cadb67c8e Mon Sep 17 00:00:00 2001 From: foobar Date: Wed, 18 Oct 2000 14:14:14 +0000 Subject: [PATCH] Fixed crash (bus error) in readdir() and session cleanup when compiled with Sun CC. --- ext/session/mod_files.c | 2 +- ext/standard/dir.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 8abc31721d..3083bdea66 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -156,7 +156,7 @@ static void ps_files_open(ps_files *data, const char *key) static int ps_files_cleanup_dir(const char *dirname, int maxlifetime) { DIR *dir; - char dentry[sizeof(struct dirent) + MAXPATHLEN + 1]; + char dentry[sizeof(struct dirent) + MAXPATHLEN]; struct dirent *entry = (struct dirent *) &dentry; struct stat sbuf; char buf[MAXPATHLEN]; diff --git a/ext/standard/dir.c b/ext/standard/dir.c index eeebfa5c00..ca5694e44a 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -289,7 +289,7 @@ PHP_FUNCTION(readdir) { pval **id, **tmp, *myself; php_dir *dirp; - char entry[sizeof(struct dirent)+MAXPATHLEN+1]; + char entry[sizeof(struct dirent)+MAXPATHLEN]; struct dirent *result = (struct dirent *)&entry; /* patch for libc5 readdir problems */ DIRLS_FETCH(); -- 2.40.0