php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #73002
Patch oci8_statement.patch_8_2_0 revision 2022-12-31 20:02 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_8_0_9 revision 2021-08-30 09:49 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_8_0_0 revision 2020-08-17 10:52 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_4_0boolean2 revision 2019-12-16 10:52 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_4_0boolean revision 2019-12-16 10:17 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_4_0 revision 2019-11-27 10:12 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_3_0_RC2 revision 2018-10-01 11:57 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_3_0 revision 2018-06-12 15:01 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_1_11 revision 2017-10-29 14:53 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_1_8 revision 2017-08-10 13:06 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_1_4 revision 2017-04-28 08:33 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_0_13_v2 revision 2016-11-14 19:12 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_0_13 revision 2016-11-14 12:11 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement_v2.patch_7_0_11 revision 2016-09-16 11:13 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch_7_0_11 revision 2016-09-16 10:28 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement_v2.patch revision 2016-09-08 10:22 UTC by lzsiga at freemail dot c3 dot hu
Patch oci8_statement.patch revision 2016-09-02 11:14 UTC by lzsiga at freemail dot c3 dot hu

Patch oci8_statement.patch for OCI8 related Bug #73002

Patch version 2016-09-02 11:14 UTC

Return to Bug #73002 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: lzsiga@freemail.c3.hu

--- oci8_statement.~c	2016-08-17 21:51:00.000000000 +0200
+++ oci8_statement.c	2016-09-02 12:37:15.548660480 +0200
@@ -975,17 +975,19 @@
 		}
 		zval_dtor(val);
 		ZVAL_NULL(val);
-	} else if (Z_TYPE_P(bind->zval) == IS_STRING
-			   && Z_STRLEN_P(bind->zval) > 0
-			   && Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] != '\0') {
-		/* The post- PHP 5.3 feature for "interned" strings disallows
-		 * their reallocation but (i) any IN binds either interned or
-		 * not should already be null terminated and (ii) for OUT
-		 * binds, php_oci_bind_out_callback() should have allocated a
-		 * new string that we can modify here.
-		 */
-		Z_STR_P(bind->zval) = zend_string_extend(Z_STR_P(bind->zval), Z_STRLEN_P(bind->zval)+1, 0);
-		Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0';
+	} else if (Z_TYPE_P(bind->zval) == IS_STRING) {
+		Z_STRLEN_P(bind->zval)= bind->dummy_len;
+		if (Z_STRLEN_P(bind->zval) > 0 &&
+		    Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] != '\0') {
+			/* The post- PHP 5.3 feature for "interned" strings disallows
+			 * their reallocation but (i) any IN binds either interned or
+			 * not should already be null terminated and (ii) for OUT
+			 * binds, php_oci_bind_out_callback() should have allocated a
+			 * new string that we can modify here.
+			 */
+		    Z_STR_P(bind->zval) = zend_string_extend(Z_STR_P(bind->zval), Z_STRLEN_P(bind->zval)+1, 0);
+		    Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0';
+		}
 	} else if (Z_TYPE_P(bind->zval) == IS_ARRAY) {
 		int i;
 		zval *entry = NULL;
@@ -1458,8 +1460,9 @@
 		ZVAL_STRINGL(val, NULL, Z_STRLEN(phpbind->zval) + 1);
 #endif		
 
-		/* XXX we assume that zend-zval len has 4 bytes */
-		*alenpp = (ub4*) &Z_STRLEN_P(phpbind->zval);
+		/* XXX we assume that zend-zval len has 4 bytes -- doesn't work on big endian PowerPC-64 */
+		phpbind->dummy_len= Z_STRLEN_P(phpbind->zval);
+		*alenpp = &phpbind->dummy_len;
 		*bufpp = Z_STRVAL_P(phpbind->zval);
 		*piecep = OCI_ONE_PIECE;
 		*rcodepp = &phpbind->retcode;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC