From:             
Operating system: Scientific Linux 6.1
PHP version:      Irrelevant
Package:          OCI8 related
Bug Type:         Bug
Bug description:Incorrect Invalid variable used for bind error

Description:
------------
I am seeing the following errors generated for no apparent reason when a
function 
is used as a string source:
PHP Warning:  oci_bind_by_name(): Invalid variable used for bind
PHP Warning:  oci_execute(): ORA-01008: not all variables bound

If I replace the $sim_token parameter in my FS_ORA_NEW_SIMTOKEN call with a

static string, e.g. "2", then it all works fine.

Test script:
---------------
-- The OCI8 Call --
function FS_ORA_NEW_SIMTOKEN($p_sess,$p_tkn) {
        $c = FS_ORA_CONNECT();
        $s = oci_parse($c, "begin
fs_pkg_XXXXX.new_auth(:p_sess,:p_sim);end;");
        oci_bind_by_name($s,":p_sess",$p_sess,-1,SQLT_CHR);
        oci_bind_by_name($s,":p_sim",$p_tkn,-1,SQLT_CHR);
        $exec_status=oci_execute($s);
        oci_free_statement($s);
        return $exec_status;
}
-- The Token Generator--
function FS_SIMAPI_GETTOKEN() {
        $valid_time=time()+FS_SIM_TOKLEN;
        $sesskey=htmlspecialchars(sha1(XXXXXXXXXXXXX));
        $qry_array=array(
        'mode' => 'AUTH',
        'user' => FS_SIM_UNA,
        'clientip'=>FS_SIM_SRCIP,
        'expiry' => $valid_time,
        'key' => $sesskey
        );
        $tokres=FS_SIMAPI_SIMPLEPOST("XXXXXXX AUTH",$qry_array);
        if ($tokres==false) {
                return false;
        }
        libxml_use_internal_errors(true);
        try {
        $xmlp=new SimpleXMLElement($tokres);
        } catch (Exception $e) {
                foreach(libxml_get_errors() as $error_line) {
                $error_msg = "SimpleXML: ".$error_line->message;
                FS_APPTOOL_LOGERR($error_msg);
                }
        return false;
        }
        return $xmlp->results->token;
}
-- The Application Call--
// 4 XXXXXX Token
$sim_token=FS_SIMAPI_GETTOKEN();
if($sim_token!=false) {
$sim_to_db=FS_ORA_NEW_SIMTOKEN($_COOKIE['fs_cookie'],$sim_token);
if($sim_to_db==false) {
    header("Location: " . FS_APP_HOME_URI . "?autherr=" .
urlencode(FS_ERR_SIMFAIL));
    exit;
}
} else {
    header("Location: " . FS_APP_HOME_URI . "?autherr=" .
urlencode($sim_token));
    exit;
}


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

Reply via email to