Commit Graph

9493 Commits

Author SHA1 Message Date
Lauri Kenttä
cf7e5357a4 random_int: Fix power of two check.
(x & ~x) is always 0.
((x & (~x + 1)) != x) works.
((x & (x - 1)) != 0) works too.
2015-05-10 13:00:45 +02:00
SammyK
dd2692621d Add tests for CSPRNG, fix C99 comments
Also replace one return; with RETURN_FALSE; for consistency.
2015-05-09 22:29:26 +02:00
Leigh
5f1b83e9bb Improve CSPRNG implementation 2015-05-09 21:57:59 +02:00
SammyK
bc54d139aa Initial implementation for CSPRNG API 2015-05-09 21:57:50 +02:00
Dmitry Stogov
63282d3321 Fixed returning void instead of NULL 2015-05-05 23:50:50 +03:00
Dmitry Stogov
d7351a5c74 Use Fast ZPP 2015-05-05 21:38:52 +03:00
Dmitry Stogov
b1d486c7d7 e more efficient zend_hash_*() functions 2015-05-05 16:20:29 +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
fc264da0e5 Cleanup substr_replace 2015-04-27 18:58:47 +02:00
Nikita Popov
40e465e357 Clean up some type conversions
While at it also fix some type checks in iconv and drop dead and
unported code in standard/filters.
2015-04-27 18:50:08 +02:00
Dmitry Stogov
49cf7c5d12 Don't propogate "fake" EX(called_scope) and EX(This) into each internal function.
They need quite seldom and it's cheaper to get them from corresponfing upper stack frame.
2015-04-23 12:16:37 +03:00
Anatol Belski
6a1bf93ad9 fix compilation with vc14 2015-04-22 22:25:33 +02:00
Stanislav Malyshev
dd56598d0d Merge branch 'pull-request/1238'
* pull-request/1238:
  apply a patch
2015-04-18 19:51:22 -07:00
Stanislav Malyshev
494870fded Restore fix for bug #69337 2015-04-18 15:48:09 -07:00
Nikita Popov
f616a6f1eb Fix intdiv() test 2015-04-18 17:30:28 +02:00
Bob Weinand
a302d51695 Better throw an exception in intdiv() for PHP_INT_MIN/-1 2015-04-18 15:50:29 +02: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
Masaki Kagaya
8d219f5307 apply a patch 2015-04-14 21:17:08 +09:00
Xinchen Hui
5db1a56705 Merge branch 'master' of https://git.php.net/repository/php-src 2015-04-14 19:50:03 +08:00
Xinchen Hui
a4d5a78f89 Fixed test in PHP7 2015-04-14 19:49:00 +08:00
Dmitry Stogov
28011fd14f Fixed recently introduced memory leak 2015-04-14 14:46:26 +03:00
Stanislav Malyshev
b3709bfc52 Merge branch 'PHP-5.6'
* PHP-5.6: (27 commits)
  fix non-standard C
  update NEWS
  5.4.41 next
  fix CVE num
  update NEWS
  Fix bug #69441 (Buffer Overflow when parsing tar/zip/phar in phar_set_inode)
  fix test
  fix type in fix for #69085
  fix memory leak & add test
  Fix tests
  fix CVE num
  Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability)
  Fix test
  Additional fix for bug #69324
  More fixes for bug #69152
  Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
  Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar)
  Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER)
  Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
  Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault)
  ...

Conflicts:
	Zend/zend_exceptions.c
	ext/curl/interface.c
	ext/dom/document.c
	ext/fileinfo/libmagic/softmagic.c
	ext/gd/gd.c
	ext/hash/hash.c
	ext/pgsql/pgsql.c
	ext/phar/phar.c
	ext/phar/phar_internal.h
	ext/standard/http_fopen_wrapper.c
	ext/standard/link.c
	ext/standard/streamsfuncs.c
	ext/xmlwriter/php_xmlwriter.c
	ext/zlib/zlib.c
2015-04-14 01:28:06 -07:00
Stanislav Malyshev
5776fceb16 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: (27 commits)
  fix non-standard C
  update NEWS
  5.4.41 next
  fix CVE num
  update NEWS
  Fix bug #69441 (Buffer Overflow when parsing tar/zip/phar in phar_set_inode)
  fix test
  fix type in fix for #69085
  fix memory leak & add test
  Fix tests
  fix CVE num
  Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability)
  Fix test
  Additional fix for bug #69324
  More fixes for bug #69152
  Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
  Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar)
  Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER)
  Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
  Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault)
  ...

Conflicts:
	ext/standard/http_fopen_wrapper.c
2015-04-14 01:05:01 -07:00
Dmitry Stogov
cddb5eb3e9 Fixed memory leak 2015-04-14 00:57:45 +03:00
Stanislav Malyshev
ba15e8dfd0 Merge branch 'PHP-5.4.40' into PHP-5.5.24
* PHP-5.4.40:
  fix memory leak & add test
  Fix tests
2015-04-12 23:49:16 -07:00
Stanislav Malyshev
45facd15fb fix memory leak & add test 2015-04-12 22:38:34 -07:00
Stanislav Malyshev
ed7d4977bb Merge branch 'PHP-5.4.40' into PHP-5.5.24
* PHP-5.4.40:
  Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability)
  Fix test
2015-04-12 20:13:00 -07:00
Stanislav Malyshev
d82d68742c Fix bug #69337 (php_stream_url_wrap_http_ex() type-confusion vulnerability) 2015-04-12 01:30:33 -07:00
Stanislav Malyshev
1defbb25ed Fix test 2015-04-12 00:56:02 -07:00
Stanislav Malyshev
0cb9d75cb6 Merge branch 'PHP-5.4.40' into PHP-5.5.24
* PHP-5.4.40:
  Additional fix for bug #69324
  More fixes for bug #69152
  Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions)
  Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar)
  Fixed bug #69316 (Use-after-free in php_curl related to CURLOPT_FILE/_INFILE/_WRITEHEADER)
  Fix bug #68486 and bug #69218 (segfault in apache2handler with apache 2.4)
  Fix bug #68819 (Fileinfo on specific file causes spurious OOM and/or segfault)
  Fixed bug #68901 (use after free)
  Fixed bug #68740 (NULL Pointer Dereference)
  Fix bug #66550 (SQLite prepared statement use-after-free)
  Better fix for #68601 for perf 81e9a993f2
  Fix bug #68601 buffer read overflow in gd_gif_in.c
  Revert "Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into PHP-5.4"
  Fixed bug #69293
  Add ZEND_ARG_CALLABLE_INFO to allow internal function to type hint against callable.
2015-04-11 16:56:12 -07:00
Stanislav Malyshev
a894a8155f More fixes for bug #69152 2015-04-11 16:53:22 -07:00
Stanislav Malyshev
4435b9142f Fixed bug #69353 (Missing null byte checks for paths in various PHP extensions) 2015-04-11 16:53:22 -07:00
Nikita Popov
94bea670de Fix bug #69413 2015-04-10 09:49:07 +02:00
Anthony Ferrara
94e222c14d Deprecate password_hash salt option 2015-04-09 15:51:04 -04:00
Dmitry Stogov
4d9a1883aa Fixed bug #68887 (resources are not freed correctly) 2015-04-08 13:29:42 +03:00
Xinchen Hui
fa795b0553 Fixed bug #69325 (php_copy_file_ex does not pass the argument) 2015-04-08 14:33:01 +08:00
Xinchen Hui
f23f7dfed0 Use new macros 2015-04-08 14:30:47 +08:00
Reeze Xia
624552c3d7 Fixed implicit declaration of function warning 2015-04-07 22:22:42 +08:00
Dmitry Stogov
cae0147ed3 Fixed weird operators behavior. Division by zero now emits warning and returns +/-INF, modulo by zero and intdid() throws an exception, shifts by negative offset throw exceptions. Compile-time evaluation of division by zero is disabled. 2015-04-06 14:30:05 +03:00
Xinchen Hui
b6aeab1b91 Fixed bug #69371 (Hash table collision leads to inaccessible array keys) 2015-04-05 18:45:14 +08:00
Nikita Popov
fa15ac4c37 Fix separation in array_multisort
This manifested in Zend/tests/bug52939.phpt when running without
opcache (no immutablization).
2015-04-04 10:52:43 +02:00
Dmitry Stogov
dcaa79546b Don't relay on reference-counter when parameter expected to be a reference, but value given. 2015-04-03 16:35:06 +03:00
Dmitry Stogov
ad863c1740 Convert fatal errors into EngineException 2015-04-02 14:19:52 +03:00
Anatol Belski
bdf315f5f3 fix tests 2015-04-02 11:37:02 +02:00
Dmitry Stogov
ea09a9fa32 Convert fatal errors into EngineExceptions
Make zval_update_constant_ex(), zval_update_constant(), zend_update_class_constants() and zend_ast_evaluate() return SUCCESS or FAILURE.
2015-04-02 02:05:25 +03:00
Nikita Popov
8d00385871 Reclassify E_STRICT notices
Per RFC https://wiki.php.net/rfc/reclassify_e_strict

While reviewing this, found that there are still three E_STRICTs
left in libraries - need to discuss those.
2015-04-01 11:17:55 +02:00
Nikita Popov
52fcc74875 Fix 32bit test failures due to ctor deprecation 2015-04-01 09:36:43 +02:00
Xinchen Hui
fd0baec2e9 Merge branch 'master' of https://git.php.net/repository/php-src 2015-04-01 13:06:38 +08:00
Xinchen Hui
af812eac4c Micro opt 2015-04-01 12:05:19 +08:00
Nikita Popov
6ef9216269 Finish PHP 4 constructor deprecation 2015-03-31 17:55:27 +02:00