ID:               32830
 Updated by:       [EMAIL PROTECTED]
 Reported By:      cvn at interchain dot nl
 Status:           Feedback
 Bug Type:         ODBC related
 Operating System: Linux
 PHP Version:      4CVS-2005-04-26 (stable)
 New Comment:

I would guess the patch is simply to change 'long int' to 'SDWORD' in
ext/odbc/php_odbc_includes.h:233 ? (CVS HEAD branch)



Previous Comments:
------------------------------------------------------------------------

[2005-04-28 00:14:55] [EMAIL PROTECTED]

Please provide a test case.
Or even a patch, as it seems that you know the extact problem and it's
solution (diff -u would be fine).

------------------------------------------------------------------------

[2005-04-26 10:49:34] cvn at interchain dot nl

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 this bug report at http://bugs.php.net/?id=32830&edit=1

Reply via email to