Skip to Content.
Sympa Menu

freetds - Re: MSSQL7.0 from freetds 0.45

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Bruns <camber AT umcc.ais.org>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: MSSQL7.0 from freetds 0.45
  • Date: Fri, 25 Jun 1999 19:13:03 -0400 (EDT)




On Fri, 25 Jun 1999 tetherow AT nol.org wrote:

> On 25 Jun, Brian Bruns wrote:
> > Ugh, I thought I had gotten rid of those! (There were a bunch of buffer
> > overruns, and I thought I got them all...) Good to know anyway.
> >
> > Actually (I just peeked at the code) and set_library is doing a strncpy
> > (which is correct). I am seeing a problem with the number place there by
> > tds_put_buf, which is that the source size is used even if it exceeds the
> > destination size (it should be the lesser of the two).
> >
> > Here is a replacement for tds_put_buf that should work:
> >
> > int tds_put_buf(TDSSOCKET *tds, unsigned char *buf, int dsize, int ssize)
> > {
> > char *tempbuf;
> > int cpsize;
> >
> > tempbuf = (char *) malloc(dsize+1);
> > memset(tempbuf,'\0',dsize);
> > cpsize = ssize > dsize ? dsize : ssize;
> > memcpy(tempbuf,buf, cpsize);
> > tds_put_n(tds,tempbuf,dsize);
> > free(tempbuf);
> > tds_put_byte(tds,cpsize);
> > }
>
> That fixed it.
>
Cool. I'm going to check that stuff in tonight along with come mods I made
for sybperl (once Perl finish compiling so I can test it that is...the
name clash between berkeley db and dblib is most annoying, it means I
can't get a usable Perl rpm)

I'm going to be gone sat and sun, so if I check in screwy code to CVS
it'll have to wait until monday :)

Brian

> ------------------------------------------------------------------------
> Sam Tetherow tetherow AT nol.org
> Director of Development
> Nebrask@ Online http://www.nol.org/
>





Archive powered by MHonArc 2.6.24.

Top of Page