| Bug #31220 | SQLFetch or SQLFetchScroll returns negative data length using SQL_C_WCHAR | ||
|---|---|---|---|
| Submitted: | 27 Sep 2007 2:22 | Modified: | 14 Mar 2008 19:41 |
| Reporter: | Viktor Ferenczi | ||
| Status: | Closed | ||
| Category: | Connector/ODBC | Severity: | S2 (Serious) |
| Version: | 3.51.20r750 | OS: | Linux (Ubuntu Feisty, up-to-date) |
| Assigned to: | Bugs System | Target Version: | |
| Tags: | SQLFetch, SQLFetchScroll, negative, LENGTH, string, varchar, buffer, overflow, segfault, segmentation fault, crash | ||
| Triage: | D3 (Medium) | ||
[27 Sep 2007 2:22]
Viktor Ferenczi
[27 Sep 2007 2:25]
Viktor Ferenczi
unixODBC trace output
Attachment: mysql-unixODBC-trace.log.bz2 (application/x-bzip, text), 25.33 KiB.
[3 Oct 2007 16:53]
Bogdan Degtyariov
Test case with _W functions
Attachment: bug31220.c (text/plain), 2.73 KiB.
[3 Oct 2007 16:54]
Bogdan Degtyariov
The test case above returns non-negative buffer length
[3 Oct 2007 17:50]
Bogdan Degtyariov
Tested the program in Windows: got the correct length, in HP-UX the Buffer length is 1073745752.
[6 Oct 2007 2: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 18:56]
Bogdan Degtyariov
Jim, I agree. Thanks for your note. Unfortunately, SQLLEN has not changed the situation. Results are the same.
[23 Feb 2008 6:37]
Jess Balint
fix + test
Attachment: bug31220.diff (application/octet-stream, text), 1.91 KiB.
[3 Mar 2008 11:39]
Jess Balint
Committed as rev1054, will be released in 3.51.24.
[14 Mar 2008 19: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.
