File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1309,7 +1309,6 @@ static ISC_STATUS string_filter(USHORT action, BlobControl* control)
1309
1309
*
1310
1310
**************************************/
1311
1311
filter_tmp* string;
1312
- USHORT length;
1313
1312
1314
1313
switch (action)
1315
1314
{
@@ -1322,10 +1321,14 @@ static ISC_STATUS string_filter(USHORT action, BlobControl* control)
1322
1321
return FB_SUCCESS;
1323
1322
1324
1323
case isc_blob_filter_get_segment:
1324
+ {
1325
1325
if (!(string = (filter_tmp*) control->ctl_data [1 ]))
1326
1326
return isc_segstr_eof;
1327
- length = string->tmp_length - control->ctl_data [2 ];
1328
- if (length > control->ctl_buffer_length )
1327
+
1328
+ USHORT length = string->tmp_length - control->ctl_data [2 ];
1329
+ const bool outOfBuffer = (length > control->ctl_buffer_length );
1330
+
1331
+ if (outOfBuffer)
1329
1332
length = control->ctl_buffer_length ;
1330
1333
memcpy (control->ctl_buffer , string->tmp_string + (USHORT) control->ctl_data [2 ], length);
1331
1334
control->ctl_data [2 ] += length;
@@ -1334,7 +1337,8 @@ static ISC_STATUS string_filter(USHORT action, BlobControl* control)
1334
1337
control->ctl_data [2 ] = 0 ;
1335
1338
}
1336
1339
control->ctl_segment_length = length;
1337
- return (length <= control->ctl_buffer_length ) ? FB_SUCCESS : isc_segment;
1340
+ return (!outOfBuffer) ? FB_SUCCESS : isc_segment;
1341
+ }
1338
1342
1339
1343
case isc_blob_filter_put_segment:
1340
1344
case isc_blob_filter_create:
You can’t perform that action at this time.
0 commit comments