From:             gz at moonky dot de
Operating system: linux
PHP version:      4.3.10
PHP Bug Type:     Reproducible crash
Bug description:  chunk_split() segfaults with too high chunklen

Description:
------------
chunk_split() segfaults when chunklen is too big (possible dos?)

Reproduce code:
---------------
<?php
chunk_split(".", 1000000000);
?>

Expected result:
----------------
ehrrm... ;-)

Actual result:
--------------
(gdb) bt
#0  0xb7d79cef in memcpy () from /lib/tls/libc.so.6
#1  0x080e6c21 in php_chunk_split (src=0x81f4afc "", srclen=1,
end=0x8180d20 "\r\n", endlen=2, chunklen=1000000000, 
    destlen=0xbfffd544) at
/home/moonky/src/php-4.3.9/ext/standard/string.c:1521
#2  0x080e6f98 in zif_chunk_split (ht=2, return_value=0x81ef874,
this_ptr=0x0, return_value_used=0)
    at /home/moonky/src/php-4.3.9/ext/standard/string.c:1582
[...]

-- 
Edit bug report at http://bugs.php.net/?id=31479&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31479&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31479&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31479&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31479&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31479&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31479&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31479&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31479&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31479&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31479&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31479&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31479&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31479&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31479&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31479&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31479&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31479&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31479&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31479&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31479&r=mysqlcfg

Reply via email to