Commit Graph

321 Commits

Author SHA1 Message Date
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Dmitry Stogov
0402f05ba3 Fixed possible crash on Zend/tests/bug71154.phpt 2015-12-21 15:57:53 +03:00
Nikita Popov
6a4c02e107 Fixed bug #71154 2015-12-17 22:20:29 +01:00
Dmitry Stogov
59424bb7bd Fixed bug #71006 (symbol referencing errors on Sparc/Solaris) 2015-12-03 13:28:41 +03:00
Xinchen Hui
6313e16a04 Improved fix for bug (count on symbol table) 2015-11-23 06:12:03 -08:00
Xinchen Hui
82f503f587 Re-Fixed bug #70249 (Segmentation fault while running PHPUnit tests on phpBB 3.2-dev)
Let's fixed this in the root instead
2015-11-11 12:32:46 +08:00
Xinchen Hui
2f2653aa77 Fixed bug #70805 (Segmentation faults whilst running Drupal 8 test suite) 2015-11-03 17:53:56 -08:00
Dmitry Stogov
37f0c6b5cb Add myself into list of authors of the most refactored files. 2015-08-31 11:38:16 +03:00
Nikita Popov
7f2261d24a Fix HT_ASSERT ht->nInternalPointer checks
The & was on the wrong side...
2015-08-28 18:59:46 +02:00
Dmitry Stogov
25f9e25526 Fixed bug #70187 (Notice: unserialize(): Unexpected end of serialized data) 2015-08-26 03:27:05 +03:00
Dmitry Stogov
f9f568aa1e In 95% cases we initialize "empty" array (with 8 hash slots). 2015-08-24 22:07:28 +03:00
Xinchen Hui
66866fb838 Simplify the macro (HT_DATA_SIZE/HT_HASH_SIZE is not used outside Zend) 2015-08-13 23:38:39 +08:00
Xinchen Hui
cf12da4f33 Fixed similar issues(segfault on OOM) 2015-08-13 23:02:51 +08:00
Xinchen Hui
ded3a44cfd Fixed segfault while OOM in pack_to_hash 2015-08-13 22:42:18 +08:00
Xinchen Hui
adf0e49912 zend_hash_resize seems useless, use zend_hash_extend 2015-08-13 12:19:35 +08:00
Xinchen Hui
a089ce0cc6 Fixed bug #70258 and #70253 2015-08-13 12:08:57 +08:00
Xinchen Hui
0f68f12d95 Use the same error msg with resize 2015-08-12 16:46:57 +08:00
Xinchen Hui
d75228e201 We should not silently go on if the required size can not be met 2015-08-12 16:44:51 +08:00
Xinchen Hui
60b75eb9ed Revert "We should not silently go on if the required size can not be met."
This reverts commit d2bcdec980.
2015-08-12 16:44:18 +08:00
Xinchen Hui
d2bcdec980 We should not silently go on if the required size can not be met. 2015-08-12 16:40:59 +08:00
Xinchen Hui
16f2ce8537 Hmm, we should also take care of uninitialized hashTable 2015-08-10 17:58:24 +08:00
Xinchen Hui
be54eb7db1 Fixed bug #70211 (php 7 ZEND_HASH_IF_FULL_DO_RESIZE use after free) 2015-08-10 17:02:16 +08:00
Xinchen Hui
72b0627315 Fixed bug #69521 (Segfault in gc_collect_cycles()). 2015-07-02 18:43:06 +08:00
Xinchen Hui
ab0771c60a Merge branch 'amortize-hash-compaction' of https://github.com/kaja47/php-src 2015-06-30 21:26:07 +08:00
Dmitry Stogov
7aa7627172 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 13:59:27 +03:00
Dmitry Stogov
4bd22cf1c1 Improved zend_string API (Francois Laupretre)
Squashed commit of the following:

commit d96eab8d79
Author: Francois Laupretre <francois@tekwire.net>
Date:   Fri Jun 26 01:23:31 2015 +0200

    Use the new 'ZSTR' macros in the rest of the code.

    Does not change anything to the generated code (thanks to compat macros) but cleaner.

commit b352643910
Author: Francois Laupretre <francois@tekwire.net>
Date:   Thu Jun 25 13:45:06 2015 +0200

    Improve zend_string API

    Add missing methods
2015-06-29 16:44:54 +03:00
Bob Weinand
70e86b8766 Also try __has_builtin() where builtins are used 2015-06-22 13:24:39 +02:00
Nikita Popov
23e1e1295f Clean up zend_hash_compare implementation
Split off zend_hash_compare_impl into separate function that does
not bother with recursion protection. We had two cases where
UNPROTECT_RECURSION was missing.
2015-06-20 17:35:16 +02:00
Nikita Popov
e8217a2727 Fix bug #69891 2015-06-20 17:23:58 +02:00
Nikita Popov
5bf7a3aac7 Fixed bug #69893 2015-06-20 17:14:48 +02:00
Nikita Popov
9589d26ef3 Merge branch 'PHP-5.6'
Conflicts:
	Zend/zend_hash.c
2015-06-20 16:50:37 +02:00
Nikita Popov
e09d3155a1 Merge branch 'PHP-5.5' into PHP-5.6 2015-06-20 16:40:53 +02:00
Nikita Popov
5fe078abba Fixed bug #69892 2015-06-20 16:40:14 +02:00
Dmitry Stogov
3186f913eb Fixed incorrect ZEND_FILE_LINE_CC usage 2015-06-05 13:54:10 +03:00
Xinchen Hui
0655abef1a Improve the fix for bug #69756 2015-06-05 18:42:21 +08:00
Dmitry Stogov
ed5fbf5e49 Fixed bug #69756 (Fatal error: Nesting level too deep - recursive dependency? with ===) 2015-06-05 10:04:58 +03:00
Xinchen Hui
497f9f2cda Fixed bug #69758 (Item added to array not being removed by array_pop/shift) 2015-06-05 11:54:22 +08:00
Stanislav Malyshev
60e92a3b84 set initialized flag after actual initialization happened 2015-05-31 19:37:56 -07:00
olshevskiy87
8bdec7a248 fix typos
Signed-off-by: olshevskiy87 <olshevskiy87@bk.ru>
2015-05-13 22:28:35 +04:00
Dmitry Stogov
0182eb4717 Eliminate useless checks 2015-04-27 15:54:41 +03:00
Dmitry Stogov
b250f46703 Optimized HashTable copy and cleanup function for cases without holes. 2015-04-24 22:43:50 +03:00
Dmitry Stogov
ef36d8a91e Optimized zend_hash_rehash(), added some exoectations to generate better code 2015-04-24 13:00:56 +03:00
Dmitry Stogov
6265687768 Added HashTable flag HASH_FLAG_STATIC_KEYS that is maintaned to be set if all hash table keys are numbers or interned strings.
Take this flag into account when copy or destroy HashTable to avoud useless checks for each key.
2015-04-24 09:34:50 +03:00
Dmitry Stogov
770cb1da71 Keep realpath and PCRE caches in consistency with opcache SHM. 2015-04-22 02:29:06 +03:00
Dmitry Stogov
c9da004a18 Slight zend_hash_find() optimization. 2015-04-21 23:27:44 +03:00
matason
52145ef8c6 Fix zend_hash_find documentation. 2015-04-07 22:26:16 +01:00
Dmitry Stogov
55cdde3dd6 Fixed bug #69376 (Wrong ref counting). 2015-04-07 02:35:52 +03:00
Xinchen Hui
ceb77b6472 Revert "Better to taverse reversely"
This reverts commit 51451ab84a.
2015-03-31 16:52:30 +08:00
Xinchen Hui
51451ab84a Better to taverse reversely 2015-03-30 15:26:59 +08:00
K
b3962ab940 zend_hash_do_resize: amortizing the cost of compaction
New implementation of hashtables introduced a compaction step which is
triggered when a hashtable is full but it contains at least one deleted
bucket. Therefore there is a possibility that a cleverly crafted code can
trigger this compaction step (which takes time proportional to the size of
hashtabe) by executing constatnt number of operations. When the hashtable
is full, deletion and subsequent addition or single element triggers a
table compaction and these two steps can be repeated ad infinitum. This
might be avenue for a DOS attack.

This patch allows compaction to be performed only if the hashtable contains
at least 1/32 deleted elements, otherwise the hashtable is doubled in size.
Linear amount of work caused by compaction is amortized over multiple
malicious additions and deletions.
2015-03-26 19:05:38 +01:00