]> granicus.if.org Git - php/commitdiff
fix bug#68942's patch
authorTaoguang Chen <chtg@users.noreply.github.com>
Fri, 27 Feb 2015 02:41:53 +0000 (10:41 +0800)
committerTaoguang Chen <chtg@users.noreply.github.com>
Fri, 27 Feb 2015 02:41:53 +0000 (10:41 +0800)
Fix type confusion bug in unserialize() with DateTimeZone. https://bugs.php.net/bug.php?id=68942

ext/date/php_date.c

index 720cdb61b787dc5cd6a1ec0e9977c9872d637779..81f6ae41a201fd90bc6677f5db1dd105c51607a5 100644 (file)
@@ -3713,7 +3713,7 @@ static int php_date_timezone_initialize_from_hash(zval **return_value, php_timez
        zval            **z_timezone_type = NULL;
 
        if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS && Z_TYPE_PP(z_timezone_type) == IS_LONG) {
-               if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS) {
+               if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS && Z_TYPE_PP(z_timezone) == IS_STRING) {
                        if (SUCCESS == timezone_initialize(*tzobj, Z_STRVAL_PP(z_timezone) TSRMLS_CC)) {
                                return SUCCESS;
                        }