]> granicus.if.org Git - php/commitdiff
- Fixed bug #49108 (2nd scan_dir produces seg fault)
authorFelipe Pena <felipe@php.net>
Thu, 30 Jul 2009 12:06:40 +0000 (12:06 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 30 Jul 2009 12:06:40 +0000 (12:06 +0000)
NEWS
ext/standard/dir.c

diff --git a/NEWS b/NEWS
index abc7ed152f337465b6fdd99bc13fe907c225f030..59282e885477a3d847d40047bdf53ec959b8101a 100644 (file)
--- 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:
index 31566d3398703df98bb9dd4bf0b4462f33e7738c..5beaae25f534ae3d4c0d3a20299808a5a2660293 100644 (file)
@@ -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);