com php-src: Fixed bug #69674 (SIGSEGV array.c:953): NEWS Zend/zend_hash.h ext/standard/tests/array/bug6967 4.phpt
| From: | Xinchen Hui | Date: | Wed, 29 Jul 2015 02:46:12 +0000 |
| Subject: | com php-src: Fixed bug #69674 (SIGSEGV array.c:953): NEWS Zend/zend_hash.h ext/standard/tests/array/bug6967 4.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88216@lists.php.net to get a copy of this message | ||
Commit: 7d5fb7bbf3c27017fa3bed462474aaa8d4746e72
Author: Xinchen Hui <laruence@php.net> Wed, 29 Jul 2015 10:46:12 +0800
Parents: 4d578f28df214c5faf115d3a629f9ffe82640b2b
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7d5fb7bbf3c27017fa3bed462474aaa8d4746e72
Log:
Fixed bug #69674 (SIGSEGV array.c:953)
Bugs:
https://bugs.php.net/69674
Changed paths:
M NEWS
M Zend/zend_hash.h
A ext/standard/tests/array/bug69674.phpt
Diff:
diff --git a/NEWS b/NEWS
index 6802c79..26e8160 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ PHP NEWS
(Laruence)
. Fixed bug #70117 (Unexpected return type error). (Laruence)
. Fixed bug #70106 (Inheritance by anonymous class). (Bob)
- . Implemented #70112 (Allow "dirname" to go up various times). (Remi)
+ . Fixed bug #69674 (SIGSEGV array.c:953). (cmb)
- Opcache:
. Fixed bug #70111 (Segfault when a function uses both an explicit return
@@ -20,6 +20,7 @@ PHP NEWS
- Standard:
. Fixed bug #70140 (str_ireplace/php_string_tolower - Arbitrary Code
+ . Implemented #70112 (Allow "dirname" to go up various times).. (Remi)
Execution). (Laruence)
. Fixed bug #36365 (scandir duplicates file name at every 65535th file). (cmb)
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index d71e76d..4a33b95 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -884,7 +884,7 @@ static zend_always_inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht,
__fill_ht->nNumUsed = __fill_idx; \
__fill_ht->nNumOfElements = __fill_idx; \
__fill_ht->nNextFreeElement = __fill_idx; \
- __fill_ht->nInternalPointer = 0; \
+ __fill_ht->nInternalPointer = __fill_idx ? 0 : HT_INVALID_IDX; \
} while (0)
static zend_always_inline zval *_zend_hash_append(HashTable *ht, zend_string *key, zval *zv)
diff --git a/ext/standard/tests/array/bug69674.phpt b/ext/standard/tests/array/bug69674.phpt
new file mode 100644
index 0000000..0d58b6a
--- /dev/null
+++ b/ext/standard/tests/array/bug69674.phpt
@@ -0,0 +1,8 @@
+--TEST--
+Bug #69674 (SIGSEGV array.c:953)
+--FILE--
+<?php
+var_dump(current(array_keys(array())));
+?>
+--EXPECT--
+bool(false)