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

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




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

[2005-05-06 01:00:05] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

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

[2005-04-28 01:22:36] [EMAIL PROTECTED]

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


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

[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