Re: Re: 4.0.6
| From: | Lars Westermann | Date: | Wed, 02 May 2001 20:33:19 +0000 |
| Subject: | Re: Re: 4.0.6 | ||
| References: | 1 2 3 4 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-53447@lists.php.net to get a copy of this message | ||
On 2 May 2001 13:08:06 -0700, andi@zend.com (Andi Gutmans) wrote:
>I suggest the following. Create one nice big diff with all of your fixes.
>Mail it to the extension maintainers for double checking with cc: to
>php-dev. If they don't reply in a reasonable time I'll apply the patch and
>assume you know what you're doing :)
>
>Andi
>
Thanks very much for the reply.
I have patched ./ext/interbase/interbase.c, and here is my patch
(against interbase.c ver. 1.48 (php404pl1)):
++++++++++++++++++++++++++++++++++++++++++++
$ diff interbase.c interbase.orig.c
1731d1730
< val->value.str.val[len] = 0;
1736c1735
< val->value.str.val = php_addslashes(val->value.str.val, len, &len,
1);
---
> val->value.str.val = php_addslashes(val->value.str.val, len, &len, 0);
1754d1752
<
1784,1785c1782,1783
< val->value.str.len = sprintf(string_data, "%Ld.%0*Ld",
< (ISC_INT64) (*((ISC_INT64 *)data) / (int) pow(10.0, (double)
-scale)), -scale,
---
> val->value.str.len = sprintf(string_data, "%Ld.%Ld",
> (ISC_INT64) (*((ISC_INT64 *)data) / (int) pow(10.0, (double) -scale)),
$
++++++++++++++++++++++++++++++++++++++++++++
The first diff forces a NULL-termination of the string after a
strncpy() (common practice)
Next diff removes a potential memoryleak, when working with magic
quotes.
Third diff formats NUMERIC correctly to the right of the decimal point
(field width , - scale) wasn't used to place the fractional part in
the correct place)
Hope this information is sufficient.
/Lars
PS: And the patches DO work - we couldn't do without them! :-)