#23198 [NEW]: segfault in _oci_open_session on oracle 9i
| From: | novicky at aarongroup dot cz | Date: | Mon, 14 Apr 2003 10:12:04 +0000 |
| Subject: | #23198 [NEW]: segfault in _oci_open_session on oracle 9i | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-37636@lists.php.net to get a copy of this message | ||
From: novicky at aarongroup dot cz
Operating system: Linux
PHP version: 4.3.2RC1
PHP Bug Type: OCI8 related
Bug description: segfault in _oci_open_session on oracle 9i
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 bug report at http://bugs.php.net/?id=23198&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23198&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23198&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23198&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23198&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23198&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23198&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23198&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23198&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23198&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23198&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23198&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23198&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23198&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23198&r=gnused