Bug #28758 SQLNativeSql unsafely casts SQLINTEGER * to SQLLEN *
Submitted: 29 May 2007 22:04 Modified: 6 Jun 2007 11:55
Reporter: Jim Winstead Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:3.51.15 OS:Any
Assigned to: Jim Winstead
Tags: 64-bit, SQLNativeSql

[29 May 2007 22:04] Jim Winstead
Description:
The implementation of SQLNativeSql casts its last argument (an SQLINTEGER *) to an SQLLEN * when calling copy_lresult. This is bad, because SQLLEN and SQLINTEGER are different sizes on 64-bit platforms.

How to repeat:
Inspect the code.

Suggested fix:
Use a local SQLLEN variable to handle the call to copy_lresult.
[29 May 2007 22:17] Jim Winstead
Fix bad cast of SQLINTEGER * to SQLLEN *

Attachment: bug28758.patch (text/plain), 1.96 KiB.

[31 May 2007 21:21] Jim Winstead
Committed, will be in 3.51.16.
[6 Jun 2007 11:54] MC Brown
Internal change, no documentation required.
[6 Jun 2007 11:55] MC Brown
Closing bug.