php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20424 stream_get_meta_data craches on a normal file stream
Submitted: 2002-11-14 04:36 UTC Modified: 2002-11-14 04:56 UTC
From: derick@php.net Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4CVS-2002-11-14 OS: Linux/Redhat
Private report: No CVE-ID: None
 [2002-11-14 04:36 UTC] derick@php.net
this script:

<?php
$f = fopen("/etc/passwd", "r");
var_dump(stream_get_meta_data($f));
?>

produces the following backtrace:
0x4057a67b in strlen (str=0x0) at ../sysdeps/i386/strlen.c:28
28	../sysdeps/i386/strlen.c: No such file or directory.
	in ../sysdeps/i386/strlen.c
(gdb) bt
#0  0x4057a67b in strlen (str=0x0) at ../sysdeps/i386/strlen.c:28
#1  0x0821c8bd in add_assoc_string_ex (arg=0x8382654, 
    key=0x826c362 "wrapper_type", key_len=13, str=0x0, duplicate=1)
    at /dat/dev/php/php-4.3.0pre2/Zend/zend_API.c:671
#2  0x0816ce25 in zif_stream_get_meta_data (ht=1, return_value=0x8382654, 
    this_ptr=0x0, return_value_used=1)
    at /dat/dev/php/php-4.3.0pre2/ext/standard/file.c:603
#3  0x0822b393 in execute (op_array=0x837e234)
    at /dat/dev/php/php-4.3.0pre2/Zend/zend_execute.c:1595
#4  0x0821b34a in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /dat/dev/php/php-4.3.0pre2/Zend/zend.c:839
#5  0x081eb3b8 in php_execute_script (primary_file=0xbffff970)
    at /dat/dev/php/php-4.3.0pre2/main/main.c:1542
#6  0x08237240 in main (argc=1, argv=0xbffffa14)
    at /dat/dev/php/php-4.3.0pre2/sapi/cli/php_cli.c:695
#7  0x40514306 in __libc_start_main (main=0x82369a4 <main>, argc=1, 
    ubp_av=0xbffffa14, init=0x807b468 <_init>, fini=0x8237920 <_fini>, 
    rtld_fini=0x4000d2dc <_dl_fini>, stack_end=0xbffffa0c)
    at ../sysdeps/generic/libc-start.c:129

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-14 04:56 UTC] derick@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, 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/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 12:01:29 2024 UTC