[unixODBC-support] SQLGetDiagFieldW, SQL_DIAG_MESSAGE_TEXT hangs

Frank A. U. fau at email.com
Sat Jul 27 18:28:11 BST 2013


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.

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

Thanks,
Frank

-------------- next part --------------
A non-text attachment was scrubbed...
Name: SQLGetDiagFieldW.c.patch
Type: text/x-patch
Size: 506 bytes
Desc: not available
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20130727/fb9f1a12/attachment.bin>


More information about the unixODBC-support mailing list