php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9358 HAVE_RDEV not being checked before accessing field st_rdev
Submitted: 2001-02-20 16:15 UTC Modified: 2001-02-21 02:20 UTC
From: amra at us dot ibm dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.0.4pl1 OS: OS400
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: amra at us dot ibm dot com
New email:
PHP Version: OS:

 

 [2001-02-20 16:15 UTC] amra at us dot ibm dot com
st_rdev in struct stat is being access without any regards to HAVE_RDEV in the following files:

ext/standard/filestat.c
ext/standard/file.c

file.c has the following code:

#ifdef HAVE_ST_BLKSIZE
	add_assoc_long ( return_value, "rdev" , stat_sb.st_rdev );
	add_assoc_long ( return_value , "blksize" , stat_sb.st_blksize );
#endif

and filestat.c has the following code:

#ifdef HAVE_ST_BLKSIZE
		add_next_index_long(return_value, stat_sb->st_rdev);
#else
		add_next_index_long(return_value, -1);
#endif

in both cases, it should have been checking for HAVE_ST_RDEV before accessing the st_rdev field.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-21 02:20 UTC] sas@php.net
Thanks for your report. I've committed the changes.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 00:01:35 2025 UTC