php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #76322
Patch fix-76322 revision 2021-08-06 18:11 UTC by cmb@php.net
Patch fix_for_defect revision 2018-08-10 08:39 UTC by vnkbabu@php.net

Patch fix-76322 for ibm_db2 Bug #76322

Patch version 2021-08-06 18:11 UTC

Return to Bug #76322 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: cmb@php.net

 ibm_db2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ibm_db2.c b/ibm_db2.c
index 44b746e..dbe7503 100644
--- a/ibm_db2.c
+++ b/ibm_db2.c
@@ -6239,7 +6239,7 @@ static void _php_db2_bind_fetch_helper(INTERNAL_FUNCTION_PARAMETERS, int op)
                 case SQL_DECFLOAT:
 #ifdef PASE /* i5/OS trim spaces */
                     if (stmt_res->s_i5_conn_parent->c_i5_char_trim > 0) {
-                        i5trim = strlen((char *)row_data->str_val);
+                        i5trim = out_length;
                         for(; i5trim >= 0; i5trim--) {
                             i5char = (char)(((char *)row_data->str_val)[i5trim]);
                             if (i5char == 0x00 || i5char == 0x20) {
@@ -6261,11 +6261,11 @@ static void _php_db2_bind_fetch_helper(INTERNAL_FUNCTION_PARAMETERS, int op)
 #endif /* PASE */
                     if ( op & DB2_FETCH_ASSOC ) {
                         add_assoc_stringl(return_value, (char *)stmt_res->column_info[i].name,
-                            (char *)row_data->str_val, strlen((char *)row_data->str_val));
+                            (char *)row_data->str_val, out_length);
                     }
                     if ( op & DB2_FETCH_INDEX ) {
                         add_index_stringl(return_value, i, (char *)row_data->str_val,
-                            strlen((char *)row_data->str_val));
+                            out_length);
                     }
                     break;
                 case SQL_SMALLINT:
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 03:01:28 2024 UTC