Re: assert in odbc driver for long error messages

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAHt6W4dvbrSZZikGMpDokpatL7_=toPBC3QxMGAB4ErJ7YEW-g@mail.gmail.com>
Il 17 aprile 2012 14:35, Mark Brand <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.