abies Sat Aug 16 12:09:24 2003 EDT
Modified files:
/php-src/ext/interbase interbase.c
Log:
Fixed bug #18744
Index: php-src/ext/interbase/interbase.c
diff -u php-src/ext/interbase/interbase.c:1.146 php-src/ext/interbase/interbase.c:1.147
--- php-src/ext/interbase/interbase.c:1.146 Sat Aug 16 11:30:22 2003
+++ php-src/ext/interbase/interbase.c Sat Aug 16 12:09:24 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: interbase.c,v 1.146 2003/08/16 15:30:22 abies Exp $ */
+/* $Id: interbase.c,v 1.147 2003/08/16 16:09:24 abies Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -699,7 +699,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "Interbase Support", "enabled");
- php_info_print_table_row(2, "Revision", "$Revision: 1.146 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.147 $");
#ifdef COMPILE_DL_INTERBASE
php_info_print_table_row(2, "Dynamic Module", "Yes");
#endif
@@ -3347,6 +3347,8 @@
{
zval **blob_arg, **string_arg;
ibase_blob_handle *ib_blob;
+ unsigned long put_cnt = 0, rem_cnt;
+ unsigned short chunk_size;
RESET_ERRMSG;
@@ -3360,9 +3362,15 @@
convert_to_string_ex(string_arg);
- if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, (unsigned short)
Z_STRLEN_PP(string_arg), Z_STRVAL_PP(string_arg))) {
- _php_ibase_error(TSRMLS_C);
- RETURN_FALSE;
+ for (rem_cnt = Z_STRLEN_PP(string_arg); rem_cnt > 0; rem_cnt -= chunk_size) {
+
+ chunk_size = rem_cnt > USHRT_MAX ? USHRT_MAX : rem_cnt;
+
+ if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, chunk_size,
&Z_STRVAL_PP(string_arg)[put_cnt] )) {
+ _php_ibase_error(TSRMLS_C);
+ RETURN_FALSE;
+ }
+ put_cnt += chunk_size;
}
RETURN_TRUE;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php