]> 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)
ext/standard/dir.c

index c858fec82c34033695cd2e8259f665fc807a88fe..ce45ace899cb1c01d872d70c06c47b023dc541da 100644 (file)
@@ -586,7 +586,10 @@ PHP_FUNCTION(scandir)
                return;
        }
 
-       context = php_stream_context_from_zval(zcontext, 0);
+       if (zcontext) {
+               context = php_stream_context_from_zval(zcontext, 0);
+       }
+
        if (FAILURE == php_stream_path_param_encode(ppdirn, &dirn, &dirn_len, REPORT_ERRORS, context)) {
                RETURN_FALSE;
        }