Skip to Content.
Sympa Menu

freetds - Re: [freetds] assert in odbc driver for long error messages

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] assert in odbc driver for long error messages
  • Date: Fri, 20 Apr 2012 21:45:40 +0100

Il 17 aprile 2012 14:35, Mark Brand <mabrand AT mabrand.nl> ha scritto:
> Hi,
>
> It seems that a rather long error message raised from a stored procedure
> triggers an ASSERT in the FreeTDS ODBC driver:
>
> unicode: odbc_util.c:391: odbc_set_string_flag: Assertion `dest == ((void
> *)0) || dest-(SQLWCHAR*) buffer == out_len' failed.
> Aborted
>
> The attached rather primitive code illustrates the problem. The stored
> procedure is in the comment at the top.
>
> I'm not very familiar with the code in question, but it looks to me that
> odbc_set_string_flag() is copying more than bytes than the limit imposed by
> cbBuffer, which is called cbErrorMsgMax from tdsdump_log() in error.c. In my
> debugger I see that initial_size is 1024 while out_len is 1127 just before
> the ASSERT.
>
> regards,
>
> Mark
>

Adapted and added to our test suite

http://gitorious.org/freetds/freetds/commit/dc5c5bf68f947a69af01939d7f4ce003363e64c9

Still fails, work in progress.

Frediano




Archive powered by MHonArc 2.6.24.

Top of Page