#35617 [NEW]: stristr() always segfaults

From: Date: Fri, 09 Dec 2005 22:13:13 +0000
Subject: #35617 [NEW]: stristr() always segfaults
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-90184@lists.php.net to get a copy of this message
From:             kennyt@php.net
Operating system: Linux 2.6.14
PHP version:      6CVS-2005-12-09 (CVS)
PHP Bug Type:     Reproducible crash
Bug description:  stristr() always segfaults

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


Thread (2 messages)

« previous php.bugs (#90184) next »