with \0).
- Sockets extension:
. Fixed bug #51958 (socket_accept() fails on IPv6 server sockets). (Gustavo)
+- SPL extension:
+ . Fixed bug #54291 (Crash iterating DirectoryIterator for dir name starting
+ with \0). (Gustavo)
+
17 Mar 2011, PHP 5.3.6
- Upgraded bundled Sqlite3 to version 3.7.4. (Ilia)
- Upgraded bundled PCRE to version 8.11. (Ilia)
intern->u.dir.index = 0;
if (EG(exception) || intern->u.dir.dirp == NULL) {
- /* throw exception: should've been already happened */
intern->u.dir.entry.d_name[0] = '\0';
+ if (!EG(exception)) {
+ /* open failed w/out notice (turned to exception due to EH_THROW) */
+ zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0
+ TSRMLS_CC, "Failed to open directory \"%s\"", path);
+ }
} else {
do {
spl_filesystem_dir_read(intern TSRMLS_CC);
--- /dev/null
+--TEST--
+Bug #54291 (Crash iterating DirectoryIterator for dir name starting with \0)
+--FILE--
+<?php
+$dir = new DirectoryIterator("\x00/abc");
+$dir->isFile();
+--EXPECTF--
+Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Failed to open directory ""' in %s:%d
+Stack trace:
+#0 %s(%d): DirectoryIterator->__construct('?/abc')
+#1 {main}
+ thrown in %s on line %d
+