Fixed bug #39602 (Invalid session.save_handler crashes PHP)

This commit is contained in:
Dmitry Stogov 2006-11-23 08:07:05 +00:00
parent e8180067b9
commit 6a8f267db6
3 changed files with 18 additions and 1 deletions

1
NEWS
View File

@ -41,6 +41,7 @@ PHP NEWS
php_filter.h).
- Fixed wrong signature initialization in imagepng (Takeshi Abe)
- Added optimization for imageline with horizontal and vertial lines (Pierre)
- Fixed bug #39602 (Invalid session.save_handler crashes PHP). (Dmitry)
- Fixed bug #39576 (array_walk() doesn't separate userdata zval). (Tony)
- Fixed bug #39538 (fgetcsv can't handle starting newlines and trailing odd
number of backslashes). (David Soria Parra, Pierre)

13
Zend/tests/bug39602.phpt Executable file
View File

@ -0,0 +1,13 @@
--TEST--
Bug #39602 (Invalid session.save_handler crashes PHP)
--INI--
session.save_handler=qwerty
--FILE--
<?php
ini_set("session.save_handler","files");
$x = new stdClass();
echo "ok";
?>
--EXPECT--
ok
Fatal error: Unknown: Cannot find save handler qwerty in Unknown on line 0

View File

@ -64,8 +64,11 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC)
{
zend_uint i = 1;
zend_uint i;
if (!objects->object_buckets) {
return;
}
for (i = 1; i < objects->top ; i++) {
if (objects->object_buckets[i].valid) {
objects->object_buckets[i].destructor_called = 1;