This commit is contained in:
Antony Dovgal 2006-12-25 21:47:02 +00:00
parent 7efb0a14f4
commit 7dc7882745

View File

@ -591,7 +591,8 @@ int php_oci_statement_execute(php_oci_statement *statement, ub4 mode TSRMLS_DC)
outcol->storage_size4 *= 3;
dynamic = OCI_DEFAULT;
buf = outcol->data = (text *) ecalloc(1, outcol->storage_size4);
buf = outcol->data = (text *) safe_emalloc(1, outcol->storage_size4, 0);
memset(buf, 0, outcol->storage_size4);
break;
}
@ -1312,11 +1313,13 @@ php_oci_bind *php_oci_bind_array_helper_string(zval* var, long max_table_length,
}
bind = emalloc(sizeof(php_oci_bind));
bind->array.elements = (text *)ecalloc(1, max_table_length * sizeof(text) * (maxlength + 1));
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));
bind->array.old_length = bind->array.current_length;
bind->array.max_length = maxlength;
bind->array.element_lengths = ecalloc(1, max_table_length * sizeof(ub2));
bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0);
memset(bind->array.element_lengths, 0, max_table_length*sizeof(ub2));
zend_hash_internal_pointer_reset(hash);
@ -1367,7 +1370,8 @@ php_oci_bind *php_oci_bind_array_helper_number(zval* var, long max_table_length
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
bind->array.max_length = sizeof(ub4);
bind->array.element_lengths = ecalloc(1, max_table_length * sizeof(ub2));
bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0);
memset(bind->array.element_lengths, 0, max_table_length * sizeof(ub2));
zend_hash_internal_pointer_reset(hash);
for (i = 0; i < max_table_length; i++) {
@ -1403,7 +1407,8 @@ php_oci_bind *php_oci_bind_array_helper_double(zval* var, long max_table_length
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
bind->array.max_length = sizeof(double);
bind->array.element_lengths = ecalloc(1, max_table_length * sizeof(ub2));
bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0);
memset(bind->array.element_lengths, 0, max_table_length * sizeof(ub2));
zend_hash_internal_pointer_reset(hash);
for (i = 0; i < max_table_length; i++) {
@ -1439,7 +1444,8 @@ php_oci_bind *php_oci_bind_array_helper_date(zval* var, long max_table_length, p
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
bind->array.max_length = sizeof(OCIDate);
bind->array.element_lengths = ecalloc(1, max_table_length * sizeof(ub2));
bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0);
memset(bind->array.element_lengths, 0, max_table_length * sizeof(ub2));
zend_hash_internal_pointer_reset(hash);
for (i = 0; i < max_table_length; i++) {