1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 03:03:26 +02:00
Commit Graph

261 Commits

Author SHA1 Message Date
Christoph M. Becker c596b02a5b Merge branch 'pull-request/2120' into PHP-5.6 2016-09-24 17:52:15 +02:00
Stanislav Malyshev 19866fb76c Fix various int size overflows.
Add function for detection of string zvals with length that does not fit
INT_MAX.
2016-09-12 21:04:23 -07:00
Christoph M. Becker 5880428dac Fix potential memory issue with USE_ZEND_ALLOC=0
The PHP core and extensions are written with the assumption that memory
allocation either succeeds, or the allocator bails out (i.e. the allocator
is infallible). Therefore the result of emalloc() and friends are not checked
for NULL values.

However, with USE_ZEND_ALLOC=0, malloc() and friends are used as allocators,
but these are fallible, i.e. they return NULL instead of bailing out if they
fail. This easily leads to invalid memory accesses in the following, such as
in <https://bugs.php.net/73032>. Some of these cases may constitute
exploitable vulnerabilities.

Therefore we make the infallible __zend_alloc() and friends the default for
USE_ZEND_ALLOC=0.
2016-09-07 22:50:53 +02:00
Xinchen Hui 3537e95dae bump year which is missed in rev 49493a2 2016-01-02 17:51:24 +08:00
Kalle Sommer Nielsen de696d851f Fixed bug #69703 (Use __builtin_clzl on PowerPC) -- Patch by dja at axtens dot net
# Julien, even though 5.5 is still non security mode I don't think we should merge this patch but I leave the choice with you
2015-05-28 14:30:18 +02:00
Stanislav Malyshev c08f9c2c78 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix format
  update NEWS
  Add test for bug #69522
  Update tests
  Fix bug #69522 - do not allow int overflow
  Forgot test file
  Fix bug #69403 and other int overflows
  Fixed bug #69418 - more s->p fixes for filenames
  Fixed bug #69364 - use smart_str to assemble strings
  Fix bug #69453 - don't try to cut empty string
  Fix bug #69545 - avoid overflow when reading list

Conflicts:
	ext/pcntl/pcntl.c
	ext/standard/basic_functions.c
	ext/standard/pack.c
	ext/standard/tests/dir/opendir_variation1-win32.phpt
2015-05-12 14:24:15 -07:00
Stanislav Malyshev c591f022f8 Fix bug #69403 and other int overflows 2015-05-10 02:20:08 -07:00
Xinchen Hui 73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Xinchen Hui 47c9027772 Bump year 2014-01-03 11:06:16 +08:00
Xinchen Hui c0d060f5c0 Bump year 2014-01-03 11:04:26 +08:00
Dmitry Stogov 6414fe283e Fixed ZEND_MM_MEM_TYPE=mmap_zero 2013-12-26 11:51:32 +04:00
Ard Biesheuvel 47e21a2c40 Fix assembly of safe_address() for aarch64 2013-07-04 10:25:38 +02:00
Nuno Lopes c652cc93ec fix assembly of safe_address() for x86 and x86_64 2013-07-03 17:56:02 -04:00
Nuno Lopes 40cbceaf71 fix assembly of safe_address() for x86 and x86_64 2013-07-03 17:55:18 -04:00
Gustavo Lopes 865cc3a800 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #64729: compilation failure on x32

Conflicts:
	Zend/zend_alloc.c
2013-04-30 19:36:08 +02:00
Gustavo Lopes 514afd67b6 Fix bug #64729: compilation failure on x32 2013-04-30 19:28:24 +02:00
Ard Biesheuvel e2453276e9 Low-level ARM optimizations
- added ARM versions of zend_mm_high_bit()/zend_mm_low_bit()
- improved safe_address()
2013-02-11 14:36:58 +01:00
Ard Biesheuvel aa12cdc361 Improve x86 inline assembler
- added cc annotation to inline asm that clobbers the condition
  flags
- remove hardcoded constants (IS_LONG,IS_DOUBLE)
- remove hardcoded offsets (zval->value, zval->type)
2013-02-11 13:53:27 +01:00
Xinchen Hui a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Xinchen Hui 0a7395e009 Happy New Year 2013-01-01 16:28:54 +08:00
Stanislav Malyshev 44e3a9be7e Merge branch 'PHP-5.4'
* PHP-5.4:
  update news
  Support building PHP with the native client toolchain.
  test should fail
2012-09-17 15:58:48 -07:00
Stuart Langley 2e24d9a2b3 Support building PHP with the native client toolchain.
The native client compiler defines the C macro __x86_64__, but the size
of an unsigned int is only 4 bytes. This causes the compile to fail
because the inline asm code compiled is for an 8 byte unsigned int. Add
the correct defines to fix this.

As detailed in:
http://code.google.com/p/nativeclient/issues/detail?id=2255
2012-09-17 15:52:55 -07:00
Nuno Lopes 58d2203317 add support for the alloc_size __attribute__ (through ZEND_ATTRIBUTE_ALLOC_SIZE and ZEND_ATTRIBUTE_ALLOC_SIZE2
requires GCC >= 4.3 or clang >= 3.2 to perform anything useful
2012-05-23 22:18:01 -04:00
Derick Rethans 32edc70fe1 CS fixes. 2012-01-29 11:17:07 +00:00
Felipe Pena 8775a37559 - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena 4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Dmitry Stogov 4a25a7740d Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Dmitry Stogov e43ff1359e Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Dmitry Stogov b6173bee92 Fixed bug #55509 (segfault on x86_64 using more than 2G memory). (Laruence) 2011-09-13 07:01:46 +00:00
Dmitry Stogov 19dd70518c Fixed bug #55509 (segfault on x86_64 using more than 2G memory). (Laruence) 2011-09-13 07:01:46 +00:00
Ilia Alshanetsky 34d93f0c06 Zend Signal Handling 2011-06-22 14:23:21 +00:00
Ilia Alshanetsky d66e7291cd Missing ifdef related to the previous patch 2011-06-02 21:38:54 +00:00
Ilia Alshanetsky 939875133a Zend Signal Handling (see RFC: https://wiki.php.net/rfc/zendsignals)
This needs to go into 5.4 as well, but will wait for Pierre to review win32 situation

# Patch by Lucas Nealan, Arnaud Le Blanc, Brian Shire & Ilia Alshanetsky
2011-06-02 21:16:50 +00:00
Dmitry Stogov 6fca028fc5 MFH: Fixed bug #54957 (Memleak in alloc_globals_ctor) 2011-05-31 11:38:31 +00:00
Dmitry Stogov d0ba3e1881 Fixed bug #54957 (Memleak in alloc_globals_ctor) 2011-05-31 08:26:53 +00:00
Pierre Joye a0a603d16b - null deref fix 2011-02-07 10:25:34 +00:00
Felipe Pena 0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Dmitry Stogov 656f1fb271 Bug #51155 (Unreasonable non-emalloc allocations of memory) 2010-10-04 15:50:47 +00:00
Dmitry Stogov c2a92f3d27 Fixed bug #52888 (Zend MM shutdown crash) 2010-09-20 12:12:42 +00:00
Dmitry Stogov 411f9fbe4d We don't need to preallocate a memory segment in case we don't use zend memory manager 2010-09-08 07:52:49 +00:00
Dmitry Stogov 7c24be8672 Fixed incorrect reinitialization 2010-07-14 10:27:08 +00:00
Dmitry Stogov 3ea5bc7914 Reused single segment between requests. Saved one malloc/free for each request. 2010-07-07 10:34:50 +00:00
Pierre Joye d839e3b9a4 - try again to get a crypto context when the key container did not exist (which is likely to be the case, on a 1st call) 2010-02-01 14:56:51 +00:00
Pierre Joye 5eb4db5e8f - Ensure that stderr output are not buffered, portability for tests 2010-01-25 14:47:19 +00:00
Sebastian Bergmann d2281d1dff sed -i "s#1998-2009#1998-2010#g" **/*.c **/*.h **/*.php 2010-01-05 20:46:53 +00:00
Dmitry Stogov 4016bfcd71 Fixed bug #46074 (Bus error during running PHP CLI under IRIX 6.5.30) 2009-09-03 14:33:11 +00:00
Andi Gutmans 4f34f5b0e3 - MFH 2009-08-09 04:46:30 +00:00
Arnaud Le Blanc b4d9c79162 MFH: Take small blocks cache into account in memory_get_usage() 2009-05-30 16:42:13 +00:00
Felipe Pena dc683c85f4 - MFH: Fixed bug #47852 (Compilation failure in zend_alloc.c) (Matteo) 2009-04-01 16:55:47 +00:00
Dmitry Stogov 8f14aed31b Fixed warning 2009-03-20 11:23:00 +00:00