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)
13091309 *
13101310 **************************************/
13111311 filter_tmp* string;
1312- USHORT length;
13131312
13141313 switch (action)
13151314 {
@@ -1322,10 +1321,14 @@ static ISC_STATUS string_filter(USHORT action, BlobControl* control)
13221321 return FB_SUCCESS;
13231322
13241323 case isc_blob_filter_get_segment:
1324+ {
13251325 if (!(string = (filter_tmp*) control->ctl_data [1 ]))
13261326 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)
13291332 length = control->ctl_buffer_length ;
13301333 memcpy (control->ctl_buffer , string->tmp_string + (USHORT) control->ctl_data [2 ], length);
13311334 control->ctl_data [2 ] += length;
@@ -1334,7 +1337,8 @@ static ISC_STATUS string_filter(USHORT action, BlobControl* control)
13341337 control->ctl_data [2 ] = 0 ;
13351338 }
13361339 control->ctl_segment_length = length;
1337- return (length <= control->ctl_buffer_length ) ? FB_SUCCESS : isc_segment;
1340+ return (!outOfBuffer) ? FB_SUCCESS : isc_segment;
1341+ }
13381342
13391343 case isc_blob_filter_put_segment:
13401344 case isc_blob_filter_create:
You can’t perform that action at this time.
0 commit comments