Re: Segfaults with t1lib

From: Date: Sun, 08 Apr 2001 05:09:15 +0000
Subject: Re: Segfaults with t1lib
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47628@lists.php.net to get a copy of this message
larsi@gnus.org (Lars Magne Ingebrigtsen) writes: > php-4.0.4pl1 compiled with --with-t1lib alternatively segfaults or > gives error messages, depending on where you call ImagePsText(). I don't know anything about php's internals, but since 4.0.3 worked, and 4.0.4pl1 didn't I just compared the two versions of the function. The following patch fixes the segfault problem for me: --- gd.c~ Wed Nov 29 16:25:42 2000 +++ gd.c Sun Apr 8 06:45:44 2001 @@ -2390,6 +2390,7 @@ if (zend_get_parameters_ex(12, &img, &str, &fnt, &sz, &fg, &bg,\ &px, &py, &sp, &wd, &ang, &aas) == FAILURE) { RETURN_FALSE; } + convert_to_string_ex(str); convert_to_long_ex(sp); convert_to_long_ex(aas); convert_to_long_ex(wd); The other problem (the warning) was due to me calling ImagePsText with a non-integer px or py parameter. I'm guessing it's a bug that gd.c doesn't coerce those parameters to integers, but I leave that to others to fix. -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen

« previous php.general (#47628) next »