From: mg at iceni dot pl
Operating system: Linux
PHP version: 5CVS-2004-08-22 (dev)
PHP Bug Type: Reproducible crash
Bug description: glob crash
Description:
------------
PHP 5 crashes while using glob() function with specific
arguments.
Reproduce code:
---------------
<?php
glob(''); // crash
glob('*'); // crash
glob('*.txt'); //ok
?>
Expected result:
----------------
Actual result:
--------------
#0 0x08131300 in zif_glob (ht=1, return_value=0x830a6dc,
this_ptr=0x0, return_value_used=0)
at /home/sh/php5/ext/standard/dir.c:421
421 strncpy(cwd, globbuf.gl_pathv[0],
MAXPATHLEN);
(gdb) bt
#0 0x08131300 in zif_glob (ht=1, return_value=0x830a6dc,
this_ptr=0x0, return_value_used=0)
at /home/sh/php5/ext/standard/dir.c:421
#1 0x08229e35 in zend_do_fcall_common_helper
(execute_data=0xbfffd380)
at /home/sh/php5/Zend/zend_execute.c:2980
#2 0x0822a9a6 in zend_do_fcall_handler
(execute_data=0xbfffd380)
at /home/sh/php5/Zend/zend_execute.c:3114
#3 0x082239bd in execute (op_array=0x830af3c)
at /home/sh/php5/Zend/zend_execute.c:1498
#4 0x081f9da5 in zend_execute_scripts (type=8,
retval=0x0, file_count=3)
at /home/sh/php5/Zend/zend.c:1052
#5 0x081ab791 in php_execute_script
(primary_file=0xbffff7d0)
at /home/sh/php5/main/main.c:1633
#6 0x08231e1d in main (argc=3, argv=0xbffff894)
at /home/sh/php5/sapi/cli/php_cli.c:943
--
Edit bug report at http://bugs.php.net/?id=29791&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29791&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29791&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29791&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=29791&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=29791&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=29791&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=29791&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=29791&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=29791&r=support
Expected behavior: http://bugs.php.net/fix.php?id=29791&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=29791&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=29791&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=29791&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29791&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=29791&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=29791&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=29791&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29791&r=float