php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43386 php_array_init_globals calls memset() incorrectly
Submitted: 2007-11-23 06:54 UTC Modified: 2007-11-25 15:57 UTC
From: andy at petdance dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 5.3CVS-2007-11-23 (CVS) OS: *
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: andy at petdance dot com
New email:
PHP Version: OS:

 

 [2007-11-23 06:54 UTC] andy at petdance dot com
Description:
------------
This function in ext/standard/array.c is supposed to zero out the contents of array_globals, but will actually only zero out a single pointer's worth of data.

static void php_array_init_globals(zend_array_globals *array_globals)
{
    memset(array_globals, 0, sizeof(array_globals));
}

That should be sizeof(*array_globals).


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-25 15:57 UTC] iliaa@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC