Skip to Content.
Sympa Menu

freetds - Re: [freetds] A couple of bugs in 0.91 with dblib bcp library

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] A couple of bugs in 0.91 with dblib bcp library
  • Date: Wed, 8 Jun 2011 14:42:41 +0200

2011/5/23 Thompson, William <bill.d.thompson AT baml.com>:
> Hi,
>
> I've sorted why the code passes this if statement:
>
>       if (!data_is_null && bindcol->column_bindlen >= 0) {
>
> even when bindcol->column_bindlen = -1
>
> it's because...
>
> tds.h:  TDS_UINT column_bindlen;
>
> I'm not mad after all...
>
> I just need to decide what to do.
> I think that if you can validly pass -1 to bcp_bind (in the varlen
> parameter), then column_bindlen shouldn't be unsigned...
>
> Now I understand what's happened, I'll see waht's the best thing to do.
> The code works at the moment, but is it more by luck than judgement?
>
> Bill
>

Looking at places where column_bindlen is assigned it seems it should
be signed, not unsigned as you spot.

We should check however when this values should not be used when it's
negative. For instance is used to index fields in structures. For
instance dbbind and dbaltbind specify that this parameter is ignored
if fixed length, IMO we should correct the value to the size of the
fixed-type.

freddy77



  • Re: [freetds] A couple of bugs in 0.91 with dblib bcp library, Frediano Ziglio, 06/08/2011

Archive powered by MHonArc 2.6.24.

Top of Page