#19197 [Fbk->Opn]: Serious bug with ImageCreateTrueColor and/or ? file upload
| From: | bugsphp at yayel dot com | Date: | Fri, 30 Aug 2002 15:01:07 +0000 |
| Subject: | #19197 [Fbk->Opn]: Serious bug with ImageCreateTrueColor and/or ? file upload | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-18256@lists.php.net to get a copy of this message | ||
ID: 19197
User updated by: bugsphp@yayel.com
Reported By: bugsphp@yayel.com
-Status: Feedback
+Status: Open
Bug Type: GD related
Operating System: Linux Redhat 7.2
PHP Version: 4.2.2
New Comment:
Oh, one last thing: I talked about a bug which may be turn into a
security problem because the *entire* script seems to loop, and because
it *crashes* at the end: there is no html output (IE stops, Mozilla
alerts "this document contains no data").
Previous Comments:
------------------------------------------------------------------------
[2002-08-30 11:00:01] cynic@php.net
you'll need to cut it down to only the offending code if you want
someone look at it.
the good people who work on php have better things to do than wade
through other people's code, and even more so as 95% of it turns out to
be pilot error.
i know this sounds harsh, but try to look at it from the opposite
side.
now to your problem.
the script running 20 times looks like dying httpd processes, but
that'd be obvious from the apache logs.
if this is the case, rebuild php with --enable-debug, and post a
backtrace.
------------------------------------------------------------------------
[2002-08-30 10:51:35] bugsphp@yayel.com
I decided to publish my code:
http://yayel.com/bug/users_postpicture.php.txt
------------------------------------------------------------------------
[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