Bug #31220 | SQLFetch or SQLFetchScroll returns negative data length using SQL_C_WCHAR | ||
---|---|---|---|
Submitted: | 27 Sep 2007 0:22 | Modified: | 14 Mar 2008 18:41 |
Reporter: | Viktor Ferenczi | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / ODBC | Severity: | S2 (Serious) |
Version: | 3.51.20r750 | OS: | Linux (Ubuntu Feisty, up-to-date) |
Assigned to: | Jess Balint | CPU Architecture: | Any |
Tags: | buffer, crash, LENGTH, negative, overflow, segfault, segmentation fault, SQLFetch, SQLFetchScroll, string, varchar |
[27 Sep 2007 0:22]
Viktor Ferenczi
[27 Sep 2007 0:25]
Viktor Ferenczi
unixODBC trace output
Attachment: mysql-unixODBC-trace.log.bz2 (application/x-bzip, text), 25.33 KiB.
[3 Oct 2007 14:53]
Bogdan Degtyariov
Test case with _W functions
Attachment: bug31220.c (text/plain), 2.73 KiB.
[3 Oct 2007 14:54]
Bogdan Degtyariov
The test case above returns non-negative buffer length
[3 Oct 2007 15:50]
Bogdan Degtyariov
Tested the program in Windows: got the correct length, in HP-UX the Buffer length is 1073745752.
[6 Oct 2007 0:12]
Jim Winstead
Bogdan, one problem with your test case is that cLength is the wrong type. It should be SQLLEN, not SQLINTEGER.
[8 Oct 2007 16:56]
Bogdan Degtyariov
Jim, I agree. Thanks for your note. Unfortunately, SQLLEN has not changed the situation. Results are the same.
[23 Feb 2008 5:37]
Jess Balint
fix + test
Attachment: bug31220.diff (application/octet-stream, text), 1.91 KiB.
[3 Mar 2008 10:39]
Jess Balint
Committed as rev1054, will be released in 3.51.24.
[14 Mar 2008 18:41]
MC Brown
A note has been added to the 3.51.24 changelog: Calling SQLFetch or SQLFetchScroll would return negative data lengths when using SQL_C_WCHAR.