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 @@ -1326,7 +1326,6 @@ static ISC_STATUS string_filter(USHORT action, BlobControl* control)
1326
1326
*
1327
1327
**************************************/
1328
1328
filter_tmp* string;
1329
- USHORT length;
1330
1329
1331
1330
switch (action)
1332
1331
{
@@ -1339,10 +1338,14 @@ static ISC_STATUS string_filter(USHORT action, BlobControl* control)
1339
1338
return FB_SUCCESS;
1340
1339
1341
1340
case isc_blob_filter_get_segment:
1341
+ {
1342
1342
if (!(string = (filter_tmp*) control->ctl_data [1 ]))
1343
1343
return isc_segstr_eof;
1344
- length = string->tmp_length - control->ctl_data [2 ];
1345
- if (length > control->ctl_buffer_length )
1344
+
1345
+ USHORT length = string->tmp_length - control->ctl_data [2 ];
1346
+ const bool outOfBuffer = (length > control->ctl_buffer_length );
1347
+
1348
+ if (outOfBuffer)
1346
1349
length = control->ctl_buffer_length ;
1347
1350
memcpy (control->ctl_buffer , string->tmp_string + (USHORT) control->ctl_data [2 ], length);
1348
1351
control->ctl_data [2 ] += length;
@@ -1351,7 +1354,8 @@ static ISC_STATUS string_filter(USHORT action, BlobControl* control)
1351
1354
control->ctl_data [2 ] = 0 ;
1352
1355
}
1353
1356
control->ctl_segment_length = length;
1354
- return (length <= control->ctl_buffer_length ) ? FB_SUCCESS : isc_segment;
1357
+ return (!outOfBuffer) ? FB_SUCCESS : isc_segment;
1358
+ }
1355
1359
1356
1360
case isc_blob_filter_put_segment:
1357
1361
case isc_blob_filter_create:
You can’t perform that action at this time.
0 commit comments