#19197 [Opn]: Serious bug with ImageCreateTrueColor and/or ? file upload
| From: | bugsphp at yayel dot com | Date: | Fri, 30 Aug 2002 14:51:35 +0000 |
| Subject: | #19197 [Opn]: Serious bug with ImageCreateTrueColor and/or ? file upload | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-18254@lists.php.net to get a copy of this message | ||
ID: 19197
User updated by: bugsphp@yayel.com
Reported By: bugsphp@yayel.com
Status: Open
Bug Type: GD related
Operating System: Linux Redhat 7.2
PHP Version: 4.2.2
New Comment:
I decided to publish my code:
http://yayel.com/bug/users_postpicture.php.txt
Previous Comments:
------------------------------------------------------------------------
[2002-08-30 10:42:10] bugsphp@yayel.com
Hi
Having a script in charge of resampling uploaded pictures.
This following bug only affects Gif image with ImageCreateTrueColor()
function.
Note that things go ok with ImageCreate() function, and with jpeg/png
files and ImageCreateTrueColor() function.
The script takes and checks a fresh uploaded picture, merges it with my
logo, resizes it with ImageCopyResampled and saves both original and
thumbnails with the apropriate function (ImageGif, ImageJpg, ImagePng),
insert properties in mysql db and cleans e/t at the end.
I did use ImageCreate() for creating my thumbnails, and colors were bad
until I used ImageCreateTrueColor() BUT if I uploaded an image with
$_FILES["file"]["type"] == 'image/gif', things go weird as the script
tries 20 times to saves the files and insert into mysql (and there is
no loop coded at all!!!)
According to Apache log, my http client calls only one time the
script.
This is really bizarre and I do worry about it, since it may be a
security problem...
Using gd2.0.1 from http://www.rime.com.au/gd/, php4.2.2
with Apache
1.3.26 :
'./configure' '--with-apache=../apache_1.3.26' '--enable-trans-sid'
'--with-jpeg-dir' '--with-gd=../gd-2.0.1' '--with-tiff-dir'
'--with-png-dir' '--with-zlib-dir' '--with-pdflib'
'--enable-ftp'
'--enable-gd-native-ttf' '--with-freetype-dir=/usr/include/freetype2'
'--with-mysql=/usr/local/mysql' '--with-gettext' '--with-pgsql=/usr'
'--with-imap' '--with-kerberos' '--enable-sysvsem'
'--enable-sysvshm'
'--with-xml' '--with-db' '--enable-bcmath'
'--enable-calendar'
'--with-imap-ssl'
Tell me if you want more details or code exemples.
Thank you.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19197&edit=1