php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33401 ImageTTFText and friends are not 64-bit clean
Submitted: 2005-06-19 19:01 UTC Modified: 2005-06-19 21:35 UTC
From: os at sumu dot org Assigned:
Status: Not a bug Package: GD related
PHP Version: 5.0.4 OS: Linux x86-64
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: os at sumu dot org
New email:
PHP Version: OS:

 

 [2005-06-19 19:01 UTC] os at sumu dot org
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
oskari.saarenmaa@sumu.org
--- 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-19 21:35 UTC] sniper@php.net
Already fixed in CVS long time ago.

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 05 18:01:34 2025 UTC