summaryrefslogtreecommitdiff
path: root/Zend/zend_alloc.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-7.0' into PHP-7.1Christoph M. Becker2016-09-241-2/+2
|\
| * Merge branch 'PHP-5.6' into PHP-7.0Christoph M. Becker2016-09-241-2/+2
| |\
| | * Merge branch 'pull-request/2120' into PHP-5.6Christoph M. Becker2016-09-241-2/+2
| | |\
| | | * Fix potential memory issue with USE_ZEND_ALLOC=0Christoph M. Becker2016-09-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | Fix various int size overflows.Stanislav Malyshev2016-09-121-0/+9
| | |/ | | | | | | | | | | | | Add function for detection of string zvals with length that does not fit INT_MAX.
| | * bump year which is missed in rev 49493a2Xinchen Hui2016-01-021-1/+1
| | |
| | * Fixed bug #69703 (Use __builtin_clzl on PowerPC) -- Patch by dja at axtens ↵Kalle Sommer Nielsen2015-05-281-2/+2
| | | | | | | | | | | | | | | | | | 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
* | | Merge branch 'PHP-7.0' into PHP-7.1Xinchen Hui2016-08-171-12/+12
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.0: (48 commits) Update NEWs Unused label Fixed bug #72853 (stream_set_blocking doesn't work) fix test Bug #72663 - part 3 Bug #72663 - part 2 Bug #72663 - part 1 Update NEWS BLock test with memory leak fix tests Fix TSRM build Fix bug #72850 - integer overflow in uuencode Fixed bug #72849 - integer overflow in urlencode Fix bug #72848 - integer overflow in quoted_printable_encode caused heap corruption Fix bug #72838 - Integer overflow lead to heap corruption in sql_regcase Fix bug #72837 - integer overflow in bzdecompress caused heap corruption Fix bug #72836 - integer overflow in base64_decode caused heap corruption Fix for bug #72807 - do not produce strings with negative length Fix for bug #72790 and bug #72799 Fix bug #72730 - imagegammacorrect allows arbitrary write access ... Conflicts: ext/standard/var_unserializer.c
| * | Fix bug #72742 - memory allocator fails to realloc small block to large oneStanislav Malyshev2016-08-141-12/+12
| | |
* | | Fixed compilation warningsDmitry Stogov2016-06-281-1/+1
| | |
* | | Fixed compilation warningsDmitry Stogov2016-06-211-19/+21
| | |
* | | Added ZEND_ATTRIBUTE_FORMAT to some middind functions.Dmitry Stogov2016-06-211-11/+3
| | | | | | | | | | | | | | | "%p" replaced by ZEND_LONG_FMT to avoid compilation warnings. Fixed most incorrect use cases of format specifiers.
* | | Move builtin_ctzl portability into zend_bitset.hNikita Popov2016-05-171-42/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use this function in both zend_mm_bitset_find_one and zend_bitset_first. Maybe zend_bitset.h is not quite the right place for it, but I did not want to include this in a globally included header like zend_long.h or zend_portability.h.
* | | Use unsigned shift to clear the bit.Dmitry Stogov2016-04-291-1/+1
|/ /
* | Disable huge pages in the Zend allocator by defaultRasmus Lerdorf2016-03-221-3/+3
| | | | | | | | | | As per the discussion on internals, this is an expert feature that needs special system-level configuration and care.
* | Added ability to disable huge pages in Zend Memeory Manager through the ↵Dmitry Stogov2016-03-171-1/+11
| | | | | | | | environment variable USE_ZEND_ALLOC_HUGE_PAGES=0.
* | fix build with clang on WinodwsAnatol Belski2016-03-101-1/+1
| |
* | Fixed bug #71535 (Integer overflow in zend_mm_alloc_heap())Dmitry Stogov2016-02-241-0/+4
| |
* | bump year which is missed in rev 49493a2Xinchen Hui2016-01-021-1/+1
| |
* | Fixed bug #71006 (symbol referencing errors on Sparc/Solaris)Dmitry Stogov2015-12-031-5/+5
| |
* | manually apply the typo fix in masterXinchen Hui2015-11-071-6/+6
| |
* | Fix frequent reallocations with many small stringsDmitry Stogov2015-10-271-0/+16
| |
* | Fixed incorrect "peak" memory consumption calculation.Dmitry Stogov2015-10-131-0/+12
| |
* | Cleanup (we keep and reuse size from zend_mm_huge_list)Dmitry Stogov2015-09-221-1/+0
| |
* | Fixed reporting about repeatable "huge" memory leaks.Dmitry Stogov2015-09-221-4/+23
| |
* | Optimize zend_mm_small_size_to_bin()Bob Weinand2015-09-191-11/+13
| | | | | | | | It removes a cmov operation and has a much faster branch for small allocations (especially when handling strings) (<= 64 bytes)
* | Don't keep dangling pointer.Dmitry Stogov2015-09-101-0/+1
| |
* | Don't inline "slow" and rarely used functions.Dmitry Stogov2015-09-091-0/+31
| |
* | Fixed typo that might cause serious bugs in MM. May be it was the reason of ↵Dmitry Stogov2015-09-081-1/+1
| | | | | | | | bug #70392 (SIGSEGV during PHP shutdown).
* | Use regular huge pages instead of anonymous if available.Dmitry Stogov2015-09-021-1/+12
| |
* | Introduced additional check. Its miss might be the reason of bug #70392 ↵Dmitry Stogov2015-09-021-1/+1
| | | | | | | | (SIGSEGV during PHP shutdown)
* | Ensure proper data alignmentDmitry Stogov2015-08-311-2/+0
| |
* | Simplified integer overflow checksDmitry Stogov2015-08-281-3/+12
| |
* | Removed useless signal protectionDmitry Stogov2015-08-281-17/+1
| |
* | Fix issues with phpdbg SIGINT handlerBob Weinand2015-08-211-0/+1
| | | | | | | | Also fix valgrind warnings in allocator when not using mmap()ed memory
* | Mark error and exception functions as "cold" (Matt's idea)Dmitry Stogov2015-08-191-3/+3
| |
* | Reimplemented ability to get debug info (C source file and line number) in ↵Dmitry Stogov2015-08-111-22/+76
| | | | | | | | phpdbg without hacks and ABI breaks.
* | Fixed bug #70098 (Real memory usage doesn't decrease)Dmitry Stogov2015-08-041-39/+188
| |
* | Added missing API functionsDmitry Stogov2015-07-091-0/+14
| |
* | Replace references to PHP_WIN32 and TSRM_WIN32 with ZEND_WIN32 in Zend/, ↵Kalle Sommer Nielsen2015-07-041-1/+1
| | | | | | | | this also fixes 1 instance of where fflush(stderr) was misplaced (zend_extensions.c)
* | Also try __has_builtin() where builtins are usedBob Weinand2015-06-221-9/+5
| |
* | Reset heap usage statistics on request shutdownDmitry Stogov2015-05-181-0/+1
| |
* | Fixed phpdbg buildDmitry Stogov2015-05-141-1/+1
| |
* | Refactored custom storage API.Dmitry Stogov2015-05-141-28/+65
| |
* | Merge branch 'PHP-5.6'Stanislav Malyshev2015-05-121-5/+5
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-5.6: 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: Zend/zend_alloc.c Zend/zend_operators.c ext/ftp/ftp.c ext/pcntl/pcntl.c ext/standard/basic_functions.c ext/standard/dir.c ext/standard/file.c ext/standard/pack.c ext/standard/string.c main/rfc1867.c
| * Merge branch 'PHP-5.4' into PHP-5.5Stanislav Malyshev2015-05-121-11/+11
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| | * Fix bug #69403 and other int overflowsStanislav Malyshev2015-05-101-11/+11
| | |
| | * Bump yearXinchen Hui2014-01-031-1/+1
| | |
| | * fix assembly of safe_address() for x86 and x86_64Nuno Lopes2013-07-031-2/+2
| | |
| * | Bump yearXinchen Hui2015-01-151-1/+1
| | |