Commit Graph

1851 Commits

Author SHA1 Message Date
Dmitry Stogov
4f1b24d974 Fixed bug #73896 (spl_autoload() crashes when calls magic _call()) 2017-01-09 15:11:33 +03:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Tyson Andre
cdb7aafc23 Fix memory leak(null coalescing operator with Spl hash)
The SEPARATE_ARG_IF_REF macro increased the refcount of the object passed as a
key.
However, when the key did not exist in the ArrayAccess implementation,
the code returned early without trying to decrement the refcount.

Add a test of `??` succeeding+failing on a SplObjectStorage instance.
2016-11-20 15:46:13 -08:00
Stanislav Malyshev
3b78cabc88 More int->size_t and string overflow fixes 2016-11-05 14:00:47 -07:00
Xinchen Hui
1efb9fd32d Fixed bug #73423 (Reproducible crash with GDB backtrace) 2016-11-02 12:11:30 +08:00
Stanislav Malyshev
2301608736 Syncronize with 5.6 - __toString should return "" 2016-10-12 23:09:49 -07:00
Stanislav Malyshev
9c675607e6 Merge remote-tracking branch 'origin/PHP-7.0.12' into PHP-7.0.12
* origin/PHP-7.0.12: (99 commits)
  set versions and release date
  sync NEWS
  Revert "Fixed bug #73067 (__debugInfo crashes when throwing an exception)"
  set versions
  update NEWS
  Ignore potentially misleading dberr values
  update NEWS
  Fixed bug #73172 parse error: Invalid numeric literal
  Fix #53745: cgi.discard_path option is missing from php.ini
  update libs_versions.txt
  update libs_versions.txt
  Fixed bug #73156 (segfault on undefined function)
  Add an include path for freetype which is relevant for cmake builds
  Fix test_image_equals_file() wrt. palette images
  Fixed bug #73163
  Fix #73161: imagecreatefromgd2() may leak memory
  Fix #73159: imagegd2(): unrecognized formats may result in corrupted files
  Fix #73155: imagegd2() writes wrong chunk sizes on boundaries
  Fix #73157 (again): imagegd2() ignores 3rd param if 4 are given
  Fix #73157: imagegd2() ignores 3rd param if 4 are given
  ...
2016-10-11 16:27:13 -07:00
Stanislav Malyshev
61cdd1255d Fix bug #73257 and bug #73258 - SplObjectStorage unserialize allows use of non-object as key 2016-10-10 22:54:29 -07:00
Nikita Popov
c38f88ddb0 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-22 12:48:38 +02:00
Márcio Almada
4397306b32 fix bug related to #865
In case USE_KEY flag is active, RegexIterator->accept() should keep it's
old behavior which is to accept keys mapping arrays.

This broke after PHP 5.5 but was not noticed due to lack of tests for USE_KEY.
2016-09-22 12:46:19 +02:00
Stanislav Malyshev
07c6bdb85d Merge branch 'PHP-7.0.11' into PHP-7.0
* PHP-7.0.11: (22 commits)
  Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields
  I don't think 8cceb012a7 is needed
  Fix test
  Add check in fgetcsv in case sizeof(unit) != sizeof(size_t)
  Fix bug #73065: Out-Of-Bounds Read in php_wddx_push_element of wddx.c
  Fix bug #73035 (Out of bound when verify signature of tar phar in phar_parse_tarfile)
  Fix bug #73052 - Memory Corruption in During Deserialized-object Destruction
  Fix bug #73029 - Missing type check when unserializing SplArray
  Fix bug #72860: wddx_deserialize use-after-free
  Fix bug #73007: add locale length check
  Fix bug #72928 - Out of bound when verify signature of zip phar in phar_parse_zipfile
  sync NEWS
  Revert "Merge branch 'PHP-5.6' into PHP-7.0"
  Merge branch 'PHP-5.6' into PHP-7.0
  Merge branch 'PHP-5.6' into PHP-7.0
  Revert "Revert "Merge branch 'PHP-5.6' into PHP-7.0""
  fix version
  sync NEWS
  Fix bug #72957
  set versions
  ...
2016-09-12 21:09:30 -07:00
Stanislav Malyshev
33d0ef0fef Fix test 2016-09-12 21:04:23 -07:00
Stanislav Malyshev
ecb7f58a06 Fix bug #73029 - Missing type check when unserializing SplArray 2016-09-12 21:04:23 -07:00
Stanislav Malyshev
fab33740c5 Fix test 2016-09-12 20:15:18 -07:00
Stanislav Malyshev
022e75cba1 Fix bug #73029 - Missing type check when unserializing SplArray
(cherry picked from commit 6d16288150be33392a3249e417a0929881feb9a2)

Conflicts:
	ext/spl/spl_array.c
2016-09-12 17:42:23 +02:00
Andrea Faulds
d690014bf3 Remove zpp fallback code (always use Fast ZPP)
Squashed commit of the following:

commit 3e27fbb3d2
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Sep 11 19:14:37 2016 +0100

    Keep dummy FAST_ZPP macro for compatibility

commit 8a7cfd00de
Author: Andrea Faulds <ajf@ajf.me>
Date:   Mon Sep 5 22:36:03 2016 +0100

    Remove FAST_ZPP macro and plain zpp fallback code
2016-09-11 22:44:46 +01:00
Pierrick Charron
2597f5d665 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/spl/spl_iterators.c
2016-07-26 20:36:34 -04:00
Pierrick Charron
4c2e1a13be Fixed bug #72684 (AppendIterator segfault with closed generator) 2016-07-26 20:34:16 -04:00
Christoph M. Becker
9a2207c90a Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/spl/spl_directory.c
2016-07-22 15:27:55 +02:00
Christoph M. Becker
6b116932b2 Fix #72646: SplFileObject::getCsvControl does not return the escape character
This has obviously been missed when adding the $escape parameter to
SplFileObject::setCsvControl() in PHP 5.3, so we catch up on this.
2016-07-22 15:24:50 +02:00
Loz Calver
f5ccd71d0c Fix 72122 - don't use EH_THROW for calls to getIterator 2016-07-12 10:10:35 +02:00
Christoph M. Becker
c015095042 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/spl/spl_directory.c
2016-07-05 16:43:39 +02:00
Valentin VALCIU
4c24f170ea Fix bug #55701: GlobIterator throws LogicException
GlobIterator throws LogicException with message 'The parent constructor was
not called' on its first operation when the glob expression doesn't match
any file. It also throws on the first operation after the iteration
completes, when the glob expression matches some files.

# Resolved conflicts:
#	ext/spl/spl_directory.c
2016-07-05 16:39:25 +02:00
Stanislav Malyshev
7dde353ee7 Merge branch 'PHP-5.5' into PHP-5.6.23
* PHP-5.5:
  Fixed bug #72446 - Integer Overflow in gdImagePaletteToTrueColor() resulting in heap overflow
  update NEWS
  fix tests
  fix build
  Fix bug #72455:  Heap Overflow due to integer overflows
  Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize
  Fix bug #72407: NULL Pointer Dereference at _gdScaleVert
  Fix bug #72402: _php_mb_regex_ereg_replace_exec - double free
  Fix bug #72298	pass2_no_dither out-of-bounds access
  Fixed #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow
  Fix bug #72262 - do not overflow int
  Fix bug #72400 and #72403 - prevent signed int overflows for string lengths
  Fix bug #72275: don't allow smart_str to overflow int
  Fix bug #72340: Double Free Courruption in wddx_deserialize
  update NEWS
  Fix #66387: Stack overflow with imagefilltoborder
  Skip test which is 64bits only
  5.5.37 now

Conflicts:
	configure.in
	ext/mcrypt/mcrypt.c
	ext/spl/spl_directory.c
	main/php_version.h
2016-06-21 00:01:48 -07:00
Stanislav Malyshev
7f428cae88 fix build 2016-06-20 22:13:31 -07:00
Stanislav Malyshev
3f627e580a Fixed ##72433: Use After Free Vulnerability in PHP's GC algorithm and unserialize 2016-06-20 21:26:33 -07:00
Stanislav Malyshev
7245bff300 Fix bug #72262 - do not overflow int 2016-06-15 21:58:26 -07:00
Joe Watkins
e27a43b7be variable used out of scope 2016-04-28 15:40:28 +01:00
Xinchen Hui
7648f20de3 Fixed bug #72051 (The reference in CallbackFilterIterator doesn't work as expected) 2016-04-19 10:59:10 +08:00
Nikita Popov
b1e854f776 Fix bug #71334
Always duplicate the array before doing a sort with user-defined
comparison function, to avoid access to the intermediate
inconsistent state.

I've also dropped the "array modification" warning, as protection
against modifications is no longer relevant if we're always working
on a copy anyway.

This also required some changes to how SplArray forwards calls to
sorting functions.
2016-03-30 22:49:27 +02:00
Stanislav Malyshev
28a6ed9f9a Fix bug #71735: Double-free in SplDoublyLinkedList::offsetSet 2016-03-20 22:29:08 -07:00
Nikita Popov
f3309173f9 Fixed bug #62059 2016-03-20 18:17:44 +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
8023204d21 Fixed bug #52339
Autoloader 101: Don't throw if you fail. PHP will throw for you.
2016-03-18 20:28:58 +01:00
Nikita Popov
a2522efa9f Add extra ArrayObject::sort() test 2016-03-18 19:59:08 +01:00
Nikita Popov
094c808374 Fix bug #71838 2016-03-18 19:58:52 +01:00
Xinchen Hui
b8f0cb063f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed test script
2016-03-17 15:23:53 +08:00
Xinchen Hui
ead7632cf9 Fixed test script 2016-03-17 15:23:44 +08:00
Xinchen Hui
753bbad535 Useless check (part of #71753) 2016-03-10 15:43:22 +08:00
James Titcumb
c4b188871e Fix bug #71575 removing extra semicolons outside macros 2016-03-03 16:41:03 +01:00
Nikita Popov
fd561505f4 Fix construction of AO with overloaded object error
a) Fix uses of zend_string in error message
b) Don't assign the overloaded object as the backing storage, that
   sort of defeats the point. Instead leave the previous value.
2016-02-24 22:34:50 +01:00
Nikita Popov
0aa7163816 Fix AO object properties separation 2016-02-24 22:34:50 +01:00
Nikita Popov
079f2f7eb3 Forbid exchangeArray() during sorting
Previously this would leak.
2016-02-24 22:34:50 +01:00
Nikita Popov
eb885e9d6e Fix leak on assignment to illegal AO offset 2016-02-24 17:39:16 +01:00
Nikita Popov
ea02f57656 Don't use ht applyCount for AO sorting protection
Instead use the AOs own applyCount that just got freed up. Using the
apply count of the HashTable has various side effects, e.g. preventing
the ArrayObject from being dumped.
2016-02-24 17:18:07 +01:00
Nikita Popov
38db6ff306 Remove recursion checks from AO get_properties
These are pointless, there is no recursion (of that kind) happening
there.
2016-02-24 17:10:28 +01:00
Nikita Popov
78b29310bc Remove check_std_props arg from get_hash_table
get_properties() is the only place using it, so handle it only
there.
2016-02-22 13:09:54 +01:00
Nikita Popov
3f5c80e8c2 Don't recurse into USE_OTHER checking STD_PROP_LIST
If STD_PROP_LIST is explicitly disabled in the constructor, it
should really be disabled.
2016-02-22 13:04:19 +01:00
Nikita Popov
6c2ca18fe0 Fix typo in previous commit
Happened to be correct because array is the first member, but
definitely not what I wanted...
2016-02-22 12:39:07 +01:00