From: cvn at interchain dot nl Operating system: Linux PHP version: 4CVS-2005-04-26 (stable) PHP Bug Type: ODBC related Bug description: SQLBindCol on 64bit systems
Description: ------------ In the odbc extension SQLBindCol is called with a long int as last parameter (vallen from the odbc_result struct). This should be an SDWORD as is also used with SQLBindParameter (and the ODBC API says). This is no problem on 32bit compiled versions, only on 64bit compiled PHP versions. In short: the calls to SQLBindParameter in odbc.c are ok, the calls to SQLBindCol are not. Only with negative values like SQL_NULL the problem arises, as the value is initialised at (long int) 0, but only 'half' (SDWORD) is written by the driver. This error is not specific to a PHP version and is there since version 4. Actual result: -------------- When the SQLBindCol would return a negative value like SQL_NULL only 'half' of the long int vallen is written by the driver, causing php to think the value is really high, and will dump core when accessing the output value. -- Edit bug report at http://bugs.php.net/?id=32830&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32830&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32830&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32830&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32830&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32830&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32830&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32830&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32830&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32830&r=support Expected behavior: http://bugs.php.net/fix.php?id=32830&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32830&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32830&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32830&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32830&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32830&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32830&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32830&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32830&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32830&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32830&r=mysqlcfg