#23198 [Opn->Ctl]: segfault in _oci_open_session on oracle 9i

From: Date: Mon, 21 Apr 2003 17:54:19 +0000
Subject: #23198 [Opn->Ctl]: segfault in _oci_open_session on oracle 9i
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38009@lists.php.net to get a copy of this message
ID: 23198 Updated by: sniper@php.net Reported By: novicky at aarongroup dot cz -Status: Open +Status: Critical Bug Type: OCI8 related Operating System: Linux PHP Version: 4.3.2RC1 New Comment: Patch committed, thanks. Previous Comments: ------------------------------------------------------------------------ [2003-04-14 05:12:04] novicky at aarongroup dot cz Due to uninitialized values of charsetid in _oci_open_session() and charset in oci_do_connect() a segfault occures when charset paramter is ommited in OCILogon(). Following patch can fix it: --- php-4.3.2RC1.orig/ext/oci8/oci8.c 2003-01-31 15:21:19.000000000 +0100 +++ php-4.3.2RC1/ext/oci8/oci8.c 2003-04-14 10:53:33.000000000 +0200 @@ -2154,7 +2154,7 @@ OCISvcCtx *svchp = 0; char *hashed_details; #ifdef HAVE_OCI9 - ub2 charsetid; + ub2 charsetid = 0; #endif TSRMLS_FETCH(); @@ -2218,10 +2218,11 @@ OCI(pEnv), charset)); - session->charsetId = charsetid; oci_debug("oci_do_connect: using charset id=%d",charsetid); } + session->charsetId = charsetid; + /* create an environment using the character set id, Oracle 9i+ ONLY */ CALL_OCI(OCIEnvNlsCreate( &session->pEnv, @@ -2648,6 +2649,7 @@ username = Z_STRVAL_PP(userParam); password = Z_STRVAL_PP(passParam); dbname = Z_STRVAL_PP(dbParam); + charset = ""; } else if (zend_get_parameters_ex(2, &userParam, &passParam) == SUCCESS) { convert_to_string_ex(userParam); convert_to_string_ex(passParam); @@ -2655,6 +2657,7 @@ username = Z_STRVAL_PP(userParam); password = Z_STRVAL_PP(passParam); dbname = ""; + charset = ""; } else { WRONG_PARAM_COUNT; } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23198&edit=1

« previous php.bugs (#38009) next »