#42500 [Opn->Fbk]: memcmp does not check full array

From: Date: Mon, 03 Sep 2007 09:13:13 +0000
Subject: #42500 [Opn->Fbk]: memcmp does not check full array
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-117002@lists.php.net to get a copy of this message
ID: 42500 Updated by: jani@php.net Reported By: doppelbauer at gmx dot net -Status: Open +Status: Feedback Bug Type: GetImageSize related Operating System: any PHP Version: 5.2.4 New Comment: And the reproducing PHP script + image can be found where? Previous Comments: ------------------------------------------------------------------------ [2007-08-31 16:04:24] 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)) { ... } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42500&edit=1

« previous php.bugs (#117002) next »