On 2 May 2001 13:08:06 -0700, [EMAIL PROTECTED] (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! :-)


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to