From:             os at sumu dot org
Operating system: Linux x86-64
PHP version:      5.0.4
PHP Bug Type:     GD related
Bug description:  ImageTTFText and friends are not 64-bit clean

Description:
------------
ImageTTFText and friends are not 64-bit clean.  They pass pointers to ints
in a zend_parse_paramters call which believes it is dealing with longs.

Attached is a patch to address this problem.  This problem might exist
also in other functions or extensions, I didn't have time to check them.

---8<---8<---

Fix int/long usage in php_imagettftext_common
[EMAIL PROTECTED]
--- ext/gd/gd.c~        2005-06-19 19:40:51.000000000 +0300
+++ ext/gd/gd.c 2005-06-19 19:40:51.000000000 +0300
@@ -3109,7 +3109,8 @@
 {
        zval *IM, *EXT = NULL;
        gdImagePtr im=NULL;
-       int col = -1, x = -1, y = -1, str_len, fontname_len, i, brect[8];
+       int fontname_len, i, brect[8];
+       long col = -1, x = -1, y = -1, str_len;
        double ptsize, angle;
        unsigned char *str = NULL, *fontname = NULL;
        char *error = NULL;


Actual result:
--------------
X offset is overwritten by the setting of Y offset.

-- 
Edit bug report at http://bugs.php.net/?id=33401&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33401&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33401&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33401&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33401&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33401&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33401&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33401&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33401&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33401&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33401&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33401&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33401&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33401&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33401&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33401&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33401&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33401&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33401&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33401&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33401&r=mysqlcfg

Reply via email to