ID: 27427 Updated by: [EMAIL PROTECTED] Reported By: spam747 at mynamehere dot com -Status: Open +Status: Bogus Bug Type: GD related Operating System: Fedora Core 1 PHP Version: 4.3.4 New Comment:
Could not reproduce with latest PHP 5 snapshot. Previous Comments: ------------------------------------------------------------------------ [2004-02-27 13:27:48] spam747 at mynamehere dot com Description: ------------ Calling imageftbbox() multiple times with the same arguments gives substantially differing results if the text contains a newline. The exact results vary between executions, so an uninitialized variable or buffer overflow is suspected. The results are similar whether the function is run in Apache or from the command line. Changing fonts or the text doesn't have an effect, so long as the text contains a newline (\n). Occurs using the standard Fedora Core 1 php-4.3.4-1.1 from RPM, and also php4-STABLE-200402271630 (configure --with-gd). P.S. the provided email address is valid as-is. Reproduce code: --------------- #!/usr/bin/php -q <?php $size=8; $angle=0; $font="/usr/share/fonts/bitstream-vera/Vera.ttf"; $text="foo\nfoo"; $extra=array(); for ($i=0;$i<10;$i++) { $box=imageftbbox($size,$angle,$font,$text,$extra); echo $box[1]." ".$box[3]."\n"; } ?> Expected result: ---------------- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 (Perhaps not this exactly, but all the lines should be the same) Actual result: -------------- 1 1 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 (On occasion, the second line may match the first, but from the third line on things change) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27427&edit=1