From: doppelbauer at gmx dot net
Operating system: any
PHP version: 5.2.4
PHP Bug Type: GetImageSize related
Bug description: memcmp does not check full array
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)) {
...
}
--
Edit bug report at http://bugs.php.net/?id=42500&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=42500&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=42500&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=42500&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42500&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=42500&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42500&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42500&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42500&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42500&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42500&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=42500&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=42500&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42500&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42500&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42500&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42500&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42500&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42500&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42500&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42500&r=mysqlcfg