Skip to Content.
Sympa Menu

freetds - Re: [freetds] [PATCH] Problem with VARCHAR in sybase.

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] [PATCH] Problem with VARCHAR in sybase.
  • Date: Sun, 6 Jul 2008 08:52:44 -0400

Eddy Pronk wrote:
> The way I solved it for now inside libdbi right now is like this:
>
> case CS_CHAR_TYPE:
> case CS_TEXT_TYPE:
> case CS_VARCHAR_TYPE:
> _type = DBI_TYPE_STRING;
> datafmt->format = CS_FMT_NULLTERM;
> ++datafmt->maxlength; /* 1 extra byte for \0 */
> break;

That will make ct-lib happy, but I would worry the cure might be worse
than the disease. If datafmt->maxlength represents the size of an
allocated buffer, increasing it without reallocating will write the NULL
to unallocated memory, with predictable unpredictable [sic] results.

Looking forward to your results.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page