Skip to Content.
Sympa Menu

freetds - Re: [PHP4BETA] php4+freetds, off-by-1 truncation

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: richard AT iguana.co.nz
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: [PHP4BETA] php4+freetds, off-by-1 truncation
  • Date: Mon, 6 Dec 1999 08:21:07 +1300 (NZDT)


> Ok, this one is fixed and in CVS. Or you can patch your local copy
> thusly:
>
> In src/tds/convert.c function tds_convert_any() change
>
> return(strlen(dest));
>
> to
>
> return (strlen(dest)+1);
>
> What happens is PHP uses length binding, which for strings should include
> the null as well as the characters in the string. So, PHP cuts off what
> it thinks in the NULL but is actually the last character. sqsh and
> DBD::Sybase don't seem to rely on length binding and were uneffected by
> this bug.
>

Excellent, thankyou. Latest CVS works nicely :) And I didn't even have to
rebuild php. I love dynamic libs..

Richard.





Archive powered by MHonArc 2.6.24.

Top of Page