com php-src: Fixed uninitialized data: ext/oci8/oci8_stat ement.c

[email protected] (Dmitry Stogov)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    1517fdb36cc125ffedd52e6e00cd3bb1adefd210
Author:    Dmitry Stogov <[email protected]>         Thu, 23 Mar 2017 18:59:27 +0300
Parents:   1dbef2e27a94e3a81a3079be06659db90509971c
Branches:  PHP-7.0 PHP-7.1 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=1517fdb36cc125ffedd52e6e00cd3bb1adefd210

Log:
Fixed uninitialized data

Changed paths:
  M  ext/oci8/oci8_statement.c


Diff:
diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c
index 950affd..467e268 100644
--- a/ext/oci8/oci8_statement.c
+++ b/ext/oci8/oci8_statement.c
@@ -1722,6 +1722,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le
 	}
 	
 	bind = emalloc(sizeof(php_oci_bind));
+	ZVAL_UNDEF(&bind->parameter);
 	bind->array.elements		= (text *)safe_emalloc(max_table_length * (maxlength + 1), sizeof(text), 0);
 	memset(bind->array.elements, 0, max_table_length * (maxlength + 1) * sizeof(text));
 	bind->array.current_length	= zend_hash_num_elements(Z_ARRVAL_P(var));
@@ -1781,6 +1782,7 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le
 	hash = HASH_OF(var);
 
 	bind = emalloc(sizeof(php_oci_bind));
+	ZVAL_UNDEF(&bind->parameter);
 	bind->array.elements		= (ub4 *)safe_emalloc(max_table_length, sizeof(ub4), 0);
 	bind->array.current_length	= zend_hash_num_elements(Z_ARRVAL_P(var));
 	bind->array.old_length		= bind->array.current_length;
@@ -1820,6 +1822,7 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_le
 	hash = HASH_OF(var);
 
 	bind = emalloc(sizeof(php_oci_bind));
+	ZVAL_UNDEF(&bind->parameter);
 	bind->array.elements		= (double *)safe_emalloc(max_table_length, sizeof(double), 0);
 	bind->array.current_length	= zend_hash_num_elements(Z_ARRVAL_P(var));
 	bind->array.old_length		= bind->array.current_length;
@@ -1860,6 +1863,7 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng
 	hash = HASH_OF(var);
 
 	bind = emalloc(sizeof(php_oci_bind));
+	ZVAL_UNDEF(&bind->parameter);
 	bind->array.elements		= (OCIDate *)safe_emalloc(max_table_length, sizeof(OCIDate), 0);
 	bind->array.current_length	= zend_hash_num_elements(Z_ARRVAL_P(var));
 	bind->array.old_length		= bind->array.current_length;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.