From:             
Operating system: Linux
PHP version:      5.3.5
Package:          ODBC related
Bug Type:         Bug
Bug description:odbc seg faults with null data returned from DB2

Description:
------------
This bug happens in many of the odbc functions that handle results from a
query, 

but I'll point out one example:



The default case in php_odbc.c:

default:

if (result->values[field_ind].vallen == SQL_NULL_DATA) {

     RETURN_NULL();

} else {

     RETURN_STRINGL(result->values[field_ind].value, result-

>values[field_ind].vallen, 1);

}

break;



result->values[field_ind].vallen seems to be corrupted when fetching NULL
data 

on a 64-bit system.  Since it does not equal 

SQL_NULL_DATA, the else clause is executed causing a seg fault because it
is 

trying to handle a NULL case.

Test script:
---------------
I have no test script to show, because the only as400/db2 server I have
access to is behind a VPN at the moemnt.


-- 
Edit bug report at http://bugs.php.net/bug.php?id=54007&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=54007&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=54007&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=54007&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=54007&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=54007&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=54007&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=54007&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=54007&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=54007&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=54007&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=54007&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=54007&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=54007&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=54007&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=54007&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=54007&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=54007&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=54007&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=54007&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=54007&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=54007&r=mysqlcfg

Reply via email to