|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-08-30 10:42 UTC] bugsphp at yayel dot 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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 23:00:01 2025 UTC |
Starting program: /usr/local/apache/bin/httpd -X Program received signal SIGSEGV, Segmentation fault. 0x082318fb in compress (init_bits=3, outfile=0x83c5a98, im=0x83ec238) at gd_lzw_out.c:534 534 if ( HashTabOf (i) == fcode ) { (gdb) bt #0 0x082318fb in compress (init_bits=3, outfile=0x83c5a98, im=0x83ec238) at gd_lzw_out.c:534 #1 0x0823178e in GIFEncode (fp=0x83c5a98, GWidth=100, GHeight=35, GInterlace=0, Background=0, Transparent=-1, BitsPerPixel=1, Red=0x83ec248, Green=0x83ec648, Blue=0x83eca48, im=0x83ec238) at gd_lzw_out.c:349 #2 0x08231237 in gdImageLzwCtx (im=0x83ec238, out=0x83c5a98) at gd_lzw_out.c:67 #3 0x0823117c in gdImageGifCtx (im=0x83ec238, out=0x83c5a98) at gd_gif_out.c:23 #4 0x080b50aa in _php_image_output_ctx (ht=2, return_value=0x83dac3c, this_ptr=0x0, return_value_used=0, image_type=1, tn=0x8243caf "GIF", func_p=0x8231168 <gdImageGifCtx>) at gd_ctx.c:94 #5 0x080b91be in zif_imagegif (ht=2, return_value=0x83dac3c, this_ptr=0x0, return_value_used=0) at gd.c:1462 #6 0x081a67f3 in execute (op_array=0x83c1804) at ./zend_execute.c:1598 #7 0x08182c96 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810 #8 0x0809b0d2 in php_execute_script (primary_file=0xbffff730) at main.c:1381 #9 0x0818e2f6 in apache_php_module_main (r=0x8358814, display_source_mode=0) at sapi_apache.c:90 #10 0x080974b4 in send_php () at eval.c:41 #11 0x0809750d in send_parsed_php () at eval.c:41 #12 0x081b067b in ap_invoke_handler () at eval.c:41 #13 0x081c5243 in process_request_internal () at eval.c:41 #14 0x081c52a4 in ap_process_request () at eval.c:41 #15 0x081bc24d in child_main () at eval.c:41 #16 0x081bc3f8 in make_child () at eval.c:41 #17 0x081bc56c in startup_children () at eval.c:41 #18 0x081bcbe8 in standalone_main () at eval.c:41 #19 0x081bd457 in main () at eval.c:41 #20 0x4031e306 in __libc_start_main (main=0x81bd0a8 <main>, argc=2, ubp_av=0xbffffb64, init=0x8074b50 <_init>, fini=0x8237c40 <_fini>, rtld_fini=0x4000d2dc <_dl_fini>, stack_end=0xbffffb5c) at ../sysdeps/generic/libc-start.c:129 Ok, gif IS the problem. I'm not a C guru, but I can't understand why is there so many mysql inserts and file copies because of the buggy gd function... Again I don't know anything about C :) Thank you for your help and fixes !!