[unixODBC-support] SQLGetDiagFieldW, SQL_DIAG_MESSAGE_TEXT hangs

Frank A. U. fau at email.com
Mon Jul 29 17:46:38 BST 2013


On Mon, 2013-07-29 at 09:09 +0100, Nick Gorham wrote:
> On 27/07/13 18:28, Frank A. U. wrote:
> > Hello,
> >
> > If I call SQLGetDiagFieldW with SQL_DIAG_MESSAGE_TEXT a second time it
> > hangs.  SQLGetDiagFieldA doesn't do that.
> >
> > I looked at the source and compared the two functions. I found that
> > SQLGetDiagFieldW does not check str before it is freed.
> >
> > I attached a patch (untested) for your review.
> Can I check what source you are looking at, as 2.3.2pre has that fixed 
> from what I can see.
> 
Nice :)
I'm running unixodbc 2.3.1 on Arch Linux (64bit).

> >
> > Also I noticed that SQLGetDiagFieldW returns the number of characters
> > via string_length_ptr, which according to the MS spec is wrong, -- it
> > should be the number of bytes.  See
> > http://support.microsoft.com/kb/294169
> 
> Changed that, well spotted. I like the "Regardless of what the 
> documentation says for each ODBC function" :-)
> 




More information about the unixODBC-support mailing list