apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 55197] New: potential 64bit issues in apr_dbd_odbc.c
Date Thu, 04 Jul 2013 21:20:47 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=55197

            Bug ID: 55197
           Summary: potential 64bit issues in apr_dbd_odbc.c
           Product: APR
           Version: HEAD
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: APR-util
          Assignee: bugs@apr.apache.org
          Reporter: sf@sfritsch.de

Compiling the odbc driver on 64bit arches causes these warnings:

dbd/apr_dbd_odbc.c: In function 'odbc_open':
dbd/apr_dbd_odbc.c:1084:52: warning: cast to pointer from integer of different
size [-Wint-to-pointer-cast]
             rc = SQLSetConnectAttr(hdbc, attrs[i], (SQLPOINTER)(attrvals[i]),
0);
                                                    ^
dbd/apr_dbd_odbc.c: In function 'odbc_start_transaction':
dbd/apr_dbd_odbc.c:1177:32: warning: cast to pointer from integer of different
size [-Wint-to-pointer-cast]
                                (SQLPOINTER)handle->transaction_mode, 0);
                                ^

The problem is that some int values are cast to SQLPOINTER. Also, the
corresponding SQLGet* functions are called with sizof(int) as buffer size, but
the return value is not checked. Therefore it is not clear if odbc expects 32
or 64 bit values here. 

This should be checked. In case 64bit values are expected, the values should be
intptr_t instead of int. If 32bit is correct, the above source lines should use
a (SQLPOINTER)(intptr_t) cast to suppress the warnings.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message