Fix an error in the checking of an overflow condition.
The first overflow check is only checking the size of the new data, not
the new data + the size of the buffered data. This is due to the buffer
on the state being emptied into a local variable just before the check.
This results in overflows not being caught, but being caught a few lines
down after the copy resulting in increased CPU usage for data that is
just going to be thrown away.
Ticket #4945
0 => i,
_ => {
v = self.tcp_buffer_ts.split_off(0);
- if self.tcp_buffer_ts.len() + i.len() > 100000 {
+ if v.len() + i.len() > 100000 {
self.set_event(SMBEvent::RecordOverflow);
return 1;
};