|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-05-10 05:28 UTC] stas@php.net
-Type: Security
+Type: Bug
-Package: *General Issues
+Package: Reproducible crash
-PHP Version: 5.5.35
+PHP Version: 5.6.21
[2016-05-10 05:28 UTC] stas@php.net
[2016-06-14 08:04 UTC] stas@php.net
[2016-06-14 08:04 UTC] stas@php.net
-Status: Open
+Status: Closed
[2016-06-22 05:58 UTC] krakjoe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 10:00:02 2025 UTC |
Description: ------------ ``` typedef union _zvalue_value { long lval; /* long value */ double dval; /* double value */ struct { char *val; int len; } str; HashTable *ht; /* hash table value */ zend_object_value obj; } zvalue_value; ``` The len is defined as signed int, integer overflow is possible in some situations, that results in len into a negative value and get a corrupted string-typed ZVAL. ex: str_replace/str_ireplace ``` Z_STRLEN_P(result) = len + (char_count * (to_len - 1)); ``` PoC: ``` <?php ini_set('memory_limit', -1); $str = str_replace('B', 'AAAAAAAA', str_repeat('B', 0xffffffff/8)); var_dump(strlen($str)); ?> ```