mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
Fixed bug #18744
This commit is contained in:
parent
6561a0546b
commit
254f827c4b
1 changed files with 11 additions and 3 deletions
|
@ -3347,6 +3347,8 @@ PHP_FUNCTION(ibase_blob_add)
|
||||||
{
|
{
|
||||||
zval **blob_arg, **string_arg;
|
zval **blob_arg, **string_arg;
|
||||||
ibase_blob_handle *ib_blob;
|
ibase_blob_handle *ib_blob;
|
||||||
|
unsigned long put_cnt = 0, rem_cnt;
|
||||||
|
unsigned short chunk_size;
|
||||||
|
|
||||||
RESET_ERRMSG;
|
RESET_ERRMSG;
|
||||||
|
|
||||||
|
@ -3360,10 +3362,16 @@ PHP_FUNCTION(ibase_blob_add)
|
||||||
|
|
||||||
convert_to_string_ex(string_arg);
|
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))) {
|
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);
|
_php_ibase_error(TSRMLS_C);
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
put_cnt += chunk_size;
|
||||||
|
}
|
||||||
RETURN_TRUE;
|
RETURN_TRUE;
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue