php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42500 memcmp does not check full array
Submitted: 2007-08-31 16:04 UTC Modified: 2007-09-11 01:00 UTC
From: doppelbauer at gmx dot net Assigned:
Status: No Feedback Package: GetImageSize related
PHP Version: 5.2.4 OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: doppelbauer at gmx dot net
New email:
PHP Version: OS:

 

 [2007-08-31 16:04 UTC] doppelbauer at gmx dot net
Description:
------------
Don't know, if this is a bug in the "getimagesize()" function.


The "php_getimagetype()" compares just 3 bytes of the 4-byte array.
Source code: /ext/standard/image.c


PHPAPI int php_getimagetype(php_stream * stream, char *filetype TSRMLS_DC)
{
    ...
    PHPAPI const char php_sig_psd[4] = {'8', 'B', 'P', 'S'};
    ...
    } else if (!memcmp(filetype, php_sig_psd, 3)) {
    ...
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-09-03 09:13 UTC] jani@php.net
And the reproducing PHP script + image can be found where?
 [2007-09-11 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 14:01:29 2024 UTC