Skip to content

Commit 423613f

Browse files
author
Thies C. Arntzen
committed
@ - Make sure that OCI8 outbound variables are always zero-terminated. (Thies)
1 parent cd9fe16 commit 423613f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ext/oci8/oci8.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ PHP_RSHUTDOWN_FUNCTION(oci)
563563
{
564564
oci_debug("START php_rshutdown_oci");
565565

566-
#if 0
566+
#if 0
567567
/* XXX free all statements, rollback all outstanding transactions */
568568

569569
zend_hash_apply(OCI(user),(int (*)(void *))_session_cleanup);
@@ -649,8 +649,12 @@ _oci_bind_post_exec(void *data)
649649
zval *val = bind->zval;
650650
zval_dtor(val);
651651
ZVAL_NULL(val);
652+
} else if (bind->zval->type == IS_STRING) {
653+
bind->zval->value.str.val = realloc(bind->zval->value.str.val, bind->zval->value.str.len+1);
654+
bind->zval->value.str.val[ bind->zval->value.str.len ] = '\0';
652655
}
653656

657+
654658
return 0;
655659
}
656660

ext/oci8/php_oci8.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ typedef struct {
181181
HashTable *user;
182182

183183
OCIEnv *pEnv;
184+
185+
int in_call;
184186
} php_oci_globals;
185187

186188
extern zend_module_entry oci8_module_entry;

0 commit comments

Comments
 (0)