#35617 [Opn->Csd]: stristr() always segfaults
ID: 35617
Updated by: tony2001@php.net
Reported By: kennyt@php.net
-Status: Open
+Status: Closed
Bug Type: Reproducible crash
Operating System: Linux 2.6.14
PHP Version: 6CVS-2005-12-09 (CVS)
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-12-09 23:13:12] kennyt@php.net
Description:
------------
Current CVS' stristr() seems to segfault whenever used...
Reproduce code:
---------------
<?php
$a = 'sdfsf';
$b = 'sdf';
echo stristr($a, $b);
echo stristr($b, $a);
?>
Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1227483472 (LWP 5822)]
0x0835dd6d in _estrndup (s=0x0, length=1836345391,
__zend_filename=0x858b688 "/root/php-src/ext/standard/string.c",
__zend_lineno=2127, __zend_orig_filename=0x0,
__zend_orig_lineno=0)
at /root/php-src/Zend/zend_alloc.c:443
443 /root/php-src/Zend/zend_alloc.c: No such file or directory.
in /root/php-src/Zend/zend_alloc.c
(gdb) bt
#0 0x0835dd6d in _estrndup (s=0x0, length=1836345391,
__zend_filename=0x858b688 "/root/php-src/ext/standard/string.c",
__zend_lineno=2127, __zend_orig_filename=0x0,
__zend_orig_lineno=0)
at /root/php-src/Zend/zend_alloc.c:443
#1 0x082c8fd3 in zif_stristr (ht=2, return_value=0x8846d64,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1)
at /root/php-src/ext/standard/string.c:2127
#2 0x083aebad in zend_do_fcall_common_helper_SPEC
(execute_data=0xbfc3a7f4)
at zend_vm_execute.h:201
#3 0x083b4e20 in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0xbfc3a7f4)
at zend_vm_execute.h:1536
#4 0x083ae750 in execute (op_array=0x88424fc) at zend_vm_execute.h:92
#5 0x083822b4 in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
at /root/php-src/Zend/zend.c:1805
#6 0x0832469c in php_execute_script (primary_file=0xbfc3cbec)
at /root/php-src/main/main.c:1850
#7 0x084090c8 in main (argc=3, argv=0xbfc3cd14)
at /root/php-src/sapi/cli/php_cli.c:1072
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35617&edit=1
Thread (2 messages)