PHP 4.0 Bug #3118: Crash when using ImageTTFText

From: Date: Thu, 06 Jan 2000 16:09:38 +0000
Subject: PHP 4.0 Bug #3118: Crash when using ImageTTFText
Groups: php.dev 
Request: Send a blank email to php-dev+get-14308@lists.php.net to get a copy of this message
From: stijn@win.tue.nl Operating system: FreeBSD 3.4 PHP version: 4.0 Beta 3 PHP Bug Type: Reproduceable crash Bug description: Crash when using ImageTTFText Maybe the same bug was reported earlier as bug #2814, but I can't add comments to that, so... I've got PHP 4.0 beta 3, GD 1.7.3 patched to also support GIF output, Freetype 1.3 on FreeBSD 3.4. The example script from the manual (below) crashes httpd every time. It doesn't matter whether I output GIF or PNG, so the patch is not the problem. configure line for php: CFLAGS="-I/usr/local/include/gd -L/usr/local/lib" ./configure --prefix=/usr/local/apache --with-config-file-path=/usr/local/etc --enable-track-vars --disable-magic-quotes --with-apache=../apache_1.3.9 --with-gd --with-ttf --with-pgsql --with-readline --with-regex=php --with-zlib configure line for apache: ./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/libphp4.a Other GD functions work fine. Backtrace that I managed to get: (gdb) bt #0 0x8089927 in gdttfchar () #1 0x8089b69 in gdttfchar () #2 0x8088476 in gdImageColorResolve () #3 0x808826e in gdImageColorResolve () #4 0x80d7cf1 in mergesort () #5 0x806523b in getsockname () #6 0x8084605 in strlcat () #7 0x806360c in getsockname () #8 0x8063650 in getsockname () #9 0x80e83cf in gdCacheGet () #10 0x80fae55 in gdCacheGet () #11 0x80faeb4 in gdCacheGet () #12 0x80f28fd in gdCacheGet () #13 0x80f2a88 in gdCacheGet () #14 0x80f2be3 in gdCacheGet () #15 0x80f3194 in gdCacheGet () #16 0x80f39e7 in gdCacheGet () #17 0x804cba1 in getsockname () script (from the manual): <?php Header("Content-type: image/gif"); $im = imagecreate(400,30); $black = ImageColorAllocate($im, 0,0,0); $white = ImageColorAllocate($im, 255,255,255); ImageTTFText($im, 20, 0, 10, 20, $white, "/path/arial.ttf", "Testing... Omega: &#937;"); ImageGif($im); ImageDestroy($im); ?>

« previous php.dev (#14308) next »