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
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: 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

Pull Requests

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: Wed Nov 13 05:01:29 2024 UTC