Commit Graph

164 Commits

Author SHA1 Message Date
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Stanislav Malyshev
f901dce575 Fix bug #73257 and bug #73258 - SplObjectStorage unserialize allows use of non-object as key
(cherry picked from commit 61cdd1255d)
2016-10-14 01:36:57 +02:00
Dmitry Stogov
323b2733f6 Fixed compilation warnings 2016-06-22 00:40:50 +03:00
Dmitry Stogov
1616038698 Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
2016-06-21 16:00:37 +03:00
Nikita Popov
c4ccb5d5fa Merge branch 'PHP-7.0' 2016-03-20 17:48:22 +01:00
Nikita Popov
12f2665df8 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/spl/spl_observer.c
2016-03-20 17:48:06 +01:00
Nikita Popov
cc3cdd0057 Fixed bug #67582 2016-03-20 17:46:12 +01:00
Nikita Popov
09da666cfa Merge branch 'PHP-7.0' 2016-03-18 20:00:19 +01:00
Nikita Popov
094c808374 Fix bug #71838 2016-03-18 19:58:52 +01:00
Stanislav Malyshev
ea35de6e31 Merge branch 'PHP-7.0'
* PHP-7.0: (35 commits)
  fix tests
  update NEWS
  fix tests
  fix NEWS
  Update NEWS
  update NEWS
  Fixed bug #71475: openssl_seal() uninitialized memory usage
  Fixed bug #71488: Stack overflow when decompressing tar archives
  fix tests
  fix wrong gc sequence
  revert the API string as well
  update NEWS
  Revert "Fix #70720"
  sync NEWS
  reset ext/session to the state of 7.0.2
  update NEWS
  update NEWS
  add missing headers for SIZE_MAX
  backport the escapeshell* functions hardening branch
  add tests
  ...
2016-02-01 20:46:06 -08:00
Nikita Popov
5c327d7f5c Use handle as hash in SplObjectStorage
For the default implementation, use a more efficient integer-based
hash. The getHash() interface still requires a string.
2016-01-30 14:19:11 +01:00
Stanislav Malyshev
52e0c4081f Fix bug #71313 - Use-after-free vulnerability in SPL(SplObjectStorage, unserialize) 2016-01-17 23:23:42 -08:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Nikita Popov
cd2b0a7bb8 Drop HAVE_PACKED_OBJECT_VALUE
This check doesn't make sense anymore, we have no object_value
anymore.
2015-10-06 23:12:34 +02:00
Stanislav Malyshev
c19d59c550 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  add NEWS for fixes
  Improve fix for #70172
  Fix bug #70312 - HAVAL gives wrong hashes in specific cases
  fix test
  add test
  Fix bug #70366 - use-after-free vulnerability in unserialize() with SplDoublyLinkedList
  Fix bug #70365 - use-after-free vulnerability in unserialize() with SplObjectStorage
  Fix bug #70172 - Use After Free Vulnerability in unserialize()
  Fix bug #70388 - SOAP serialize_function_call() type confusion
  Fixed bug #70350: ZipArchive::extractTo allows for directory traversal when creating directories
  Improve fix for #70385
  Fix bug #70345 (Multiple vulnerabilities related to PCRE functions)
  Fix bug #70385 (Buffer over-read in exif_read_data with TIFF IFD tag byte value of 32 bytes)
  Fix bug #70219 (Use after free vulnerability in session deserializer)
  Fix for bug #69782
  Add CVE IDs asigned (post release) to PHP 5.4.43
  Add CVE IDs asigned to #69085 (PHP 5.4.39)
  5.4.45 next

Conflicts:
	ext/pcre/php_pcre.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	ext/zip/php_zip.c
2015-09-01 12:06:41 -07:00
Stanislav Malyshev
33d3acaae7 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Improve fix for #70172
  Fix bug #70312 - HAVAL gives wrong hashes in specific cases
  fix test
  add test
  Fix bug #70366 - use-after-free vulnerability in unserialize() with SplDoublyLinkedList
  Fix bug #70365 - use-after-free vulnerability in unserialize() with SplObjectStorage
  Fix bug #70172 - Use After Free Vulnerability in unserialize()
  Fix bug #70388 - SOAP serialize_function_call() type confusion
  Fixed bug #70350: ZipArchive::extractTo allows for directory traversal when creating directories
  Improve fix for #70385
  Fix bug #70345 (Multiple vulnerabilities related to PCRE functions)
  Fix bug #70385 (Buffer over-read in exif_read_data with TIFF IFD tag byte value of 32 bytes)
  Fix bug #70219 (Use after free vulnerability in session deserializer)
  Fix for bug #69782
  Add CVE IDs asigned (post release) to PHP 5.4.43
  Add CVE IDs asigned to #69085 (PHP 5.4.39)
  5.4.45 next

Conflicts:
	configure.in
	ext/pcre/php_pcre.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	main/php_version.h
2015-09-01 11:42:19 -07:00
Stanislav Malyshev
f06a069c46 Fix bug #70365 - use-after-free vulnerability in unserialize() with SplObjectStorage 2015-09-01 00:14:15 -07:00
Stanislav Malyshev
ed709d5aa0 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  fix test
  update NEWS
  Fix bug #70019 - limit extracted files to given directory
  Do not do convert_to_* on unserialize, it messes up references
  Fix #69793 - limit what we accept when unserializing exception
  Fixed bug #70169 (Use After Free Vulnerability in unserialize() with SplDoublyLinkedList)
  Fixed bug #70166 - Use After Free Vulnerability in unserialize() with SPLArrayObject
  ignore signatures for packages too
  Fix bug #70168 - Use After Free Vulnerability in unserialize() with SplObjectStorage
  Fixed bug #69892
  Fix bug #70014 - use RAND_bytes instead of deprecated RAND_pseudo_bytes
  Improved fix for Bug #69441
  Fix bug #70068 (Dangling pointer in the unserialization of ArrayObject items)
  Fix bug #70121 (unserialize() could lead to unexpected methods execution / NULL pointer deref)
  Fix bug #70081: check types for SOAP variables

Conflicts:
	ext/soap/php_http.c
	ext/spl/spl_observer.c
2015-08-04 15:29:13 -07:00
Stanislav Malyshev
69ed3969dd Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #70019 - limit extracted files to given directory
  Do not do convert_to_* on unserialize, it messes up references
  Fix #69793 - limit what we accept when unserializing exception
  Fixed bug #70169 (Use After Free Vulnerability in unserialize() with SplDoublyLinkedList)
  Fixed bug #70166 - Use After Free Vulnerability in unserialize() with SPLArrayObject
  ignore signatures for packages too
  Fix bug #70168 - Use After Free Vulnerability in unserialize() with SplObjectStorage
  Fixed bug #69892
  Fix bug #70014 - use RAND_bytes instead of deprecated RAND_pseudo_bytes
  Improved fix for Bug #69441
  Fix bug #70068 (Dangling pointer in the unserialization of ArrayObject items)
  Fix bug #70121 (unserialize() could lead to unexpected methods execution / NULL pointer deref)
  Fix bug #70081: check types for SOAP variables

Conflicts:
	.gitignore
	ext/date/php_date.c
	ext/spl/spl_array.c
	ext/spl/spl_observer.c
2015-08-04 14:10:57 -07:00
Stanislav Malyshev
c2e197e4ef Fix bug #70168 - Use After Free Vulnerability in unserialize() with SplObjectStorage 2015-08-01 22:01:17 -07:00
Stanislav Malyshev
feeb2fba93 fix merge 2015-08-04 23:51:55 -07:00
Stanislav Malyshev
97047e7665 Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
  fix test
  update NEWS
  Fix bug #70019 - limit extracted files to given directory
  Do not do convert_to_* on unserialize, it messes up references
  Fix #69793 - limit what we accept when unserializing exception
  Fixed bug #70169 (Use After Free Vulnerability in unserialize() with SplDoublyLinkedList)
  Fixed bug #70166 - Use After Free Vulnerability in unserialize() with SPLArrayObject
  ignore signatures for packages too
  Fix bug #70168 - Use After Free Vulnerability in unserialize() with SplObjectStorage
  Fixed bug #69892
  Fix bug #70014 - use RAND_bytes instead of deprecated RAND_pseudo_bytes
  Improved fix for Bug #69441
  Fix bug #70068 (Dangling pointer in the unserialization of ArrayObject items)
  Fix bug #70121 (unserialize() could lead to unexpected methods execution / NULL pointer deref)
  Fix bug #70081: check types for SOAP variables

Conflicts:
	Zend/zend_exceptions.c
	ext/date/php_date.c
	ext/openssl/openssl.c
	ext/phar/phar_internal.h
	ext/soap/php_http.c
	ext/spl/spl_array.c
	ext/spl/spl_dllist.c
	ext/spl/spl_observer.c
	ext/standard/tests/serialize/bug69152.phpt
	sapi/cli/tests/005.phpt
2015-08-04 16:14:24 -07:00
Tjerk Meesters
03d18d9a52 Fixed #70053 MutlitpleIterator array-keys incompatible change in PHP 7 2015-07-13 00:33:55 +08:00
Dmitry Stogov
53403fe56d Get rid of ZVAL_ZVAL() macro usages. Replace them with more clear and optimal equialent sequences. 2015-07-01 02:05:21 +03:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Rasmus Lerdorf
28d7bb97a1 Fix more proto comments 2015-06-23 17:46:20 -04:00
Dmitry Stogov
8e10e8f921 Avoid zval duplication in ZVAL_ZVAL() macro (it was necessary only in few places).
Switch from ZVAL_ZVAL() to simpler macros where possible (it makes sense to review remaining places)
2015-06-12 12:33:23 +03:00
Dmitry Stogov
d880ead8a7 Improve fast_is_[not_]identical() functions to teturn value instead of takeing additional arguments.
Pair INSTANCEOF with the following JMPZ/JMPNZ.
2015-04-29 16:43:23 +03:00
Nikita Popov
dc764bf644 Use object apply count in var_dump / print_r
Instead of using the array apply count on the debug_info array, use
the object apply count for recursion detection when dumping. This
handles recursion in a more generic way and does not require each
debug_info handler to deal with this.

This allows returning a temporary debug_info array, instead of
having to store it in the object (thus delaying destruction of the
values).

Switch SPL debug_info handlers to use a temporary array.
2015-04-15 22:00:12 +02:00
Nikita Popov
122d759618 Always throw TypeException on throwing zpp failures
Introduces a ZEND_PARSE_PARAMS_THROW flag for zpp, which forces to
report FAILURE errors using a TypeException instead of a Warning,
like it would happen in strict mode.

Adds a zend_parse_parameters_throw() convenience function, which
invokes zpp with this flag.

Converts all cases I could identify, where we currently have
throwing zpp usage in constructors and replaces them with this API.
Error handling is still replaced to EH_THROW in some cases to handle
other, domain-specific errors in constructors.
2015-04-06 11:27:34 +02:00
Xinchen Hui
9420a2a5b0 Merge branch 'PHP-5.6' 2015-03-14 11:32:09 +08:00
Xinchen Hui
96bb3b838c Merge branch 'PHP-5.5' into PHP-5.6 2015-03-14 11:31:53 +08:00
Xinchen Hui
5b87d52041 Fixed typo 2015-03-14 11:31:12 +08:00
Xinchen Hui
326ac546ab Remove TSRMLS 2015-03-14 01:04:00 +08:00
Xinchen Hui
e827d1a424 Merge branch 'PHP-5.6'
Conflicts:
	ext/spl/spl_observer.c
2015-03-14 01:01:02 +08:00
Xinchen Hui
396bc00caa Merge branch 'PHP-5.5' into PHP-5.6 2015-03-14 00:53:32 +08:00
Xinchen Hui
ed59370f0a Little improvement, update NEWs, added test 2015-03-14 00:52:53 +08:00
Dmitry Stogov
2b42d71908 Changed HashTable layout:
Removed HashTable->arHash (reduced memory consumption). Now hash slots may be accessed using HT_HASH() macro.
Hash slotas are allocated together with Buckets (before them) and lay in reverse order from HashTable->arData base address (see comments in Zend/zend_types.h)
Indexes in hash table and conflict resolution chains (Z_NEXT) may be stored as indeces or offsets in bytes, depending on system (32 or 64-bit).
HashTable data filelds are reordered to keep the most useful for zend_hash_find() data in the same CPU cache line.
2015-03-13 17:13:19 +03:00
Vektah
482500b455 Fix a leak 2015-03-13 15:54:30 +11:00
Vektah
950d3d6e9b Fix bug #69227 and #65967
This patch fixes a use (in zend_gc.c) after free (in spl_observer.c).
See https://bugs.php.net/bug.php?id=69227
2015-03-13 15:02:05 +11:00
Dmitry Stogov
8633685675 Use specialized macro for string zval creation 2015-03-12 16:53:51 +03:00
Xinchen Hui
aadf7366e0 Merge branch 'PHP-5.6'
Conflicts:
	ext/spl/spl_observer.c
2015-02-25 18:23:54 +08:00
Xinchen Hui
9641bac0f5 Merge branch 'PHP-5.5' into PHP-5.6 2015-02-25 18:22:18 +08:00
Xinchen Hui
ffdc5728c8 Fixed bug #69108 ("Segmentation fault" when (de)serializing SplObjectStorage) 2015-02-25 18:21:59 +08:00
Dmitry Stogov
e10e151e9b Merged zend_array and HashTable into the single data structure.
Now each HashTable is also zend_array, so it's refcounted and may be a subject for Copy on Write
zend_array_dup() was changed to allocate and return HashTable, instead of taking preallocated HashTable as argument.
2015-02-13 22:20:39 +03:00
Dmitry Stogov
9e70d7672d Move zend_object->guards into additional slot of zend_object->properties_table[]. As result size of objects without __get/__set/__unset/__isset magic methods is reduced. 2015-02-04 15:24:13 +03:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00