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
 [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

Add a Patch

Pull Requests

Add a Pull Request

History

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

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 12:01:31 2024 UTC