summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2009-07-30 12:06:40 +0000
committerFelipe Pena <felipe@php.net>2009-07-30 12:06:40 +0000
commitf8ee7db001a18e5640ed4e523c90b1b75ad3e0bb (patch)
tree8897fa4672467606944716561a959c7325d94a86
parent96a053288fd227cf4a27e10081439d425d4ebc71 (diff)
downloadphp-git-f8ee7db001a18e5640ed4e523c90b1b75ad3e0bb.tar.gz
- Fixed bug #49108 (2nd scan_dir produces seg fault)
-rw-r--r--NEWS1
-rw-r--r--ext/standard/dir.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index abc7ed152f..59282e8854 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,7 @@
- Fixed signature generation/validation for zip archives in ext/phar. (Greg)
- Fixed memory leak in stream_is_local(). (Felipe)
+- Fixed bug #49108 (2nd scan_dir produces seg fault). (Felipe)
- Fixed bug #49065 ("disable_functions" php.ini option does not work on
Zend extensions). (Stas)
- Fixed bug #49064 (--enable-session=shared does not work: undefined symbol:
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
index 31566d3398..5beaae25f5 100644
--- a/ext/standard/dir.c
+++ b/ext/standard/dir.c
@@ -556,7 +556,9 @@ PHP_FUNCTION(scandir)
RETURN_FALSE;
}
- context = php_stream_context_from_zval(zcontext, 0);
+ if (zcontext) {
+ context = php_stream_context_from_zval(zcontext, 0);
+ }
if (!flags) {
n = php_stream_scandir(dirn, &namelist, context, (void *) php_stream_dirent_alphasort);