]> git.ipfire.org Git - thirdparty/suricata.git/commit
smb: check correct buffer for overflow
authorJason Ish <jason.ish@oisf.net>
Tue, 15 Feb 2022 21:18:49 +0000 (15:18 -0600)
committerVictor Julien <vjulien@oisf.net>
Mon, 21 Mar 2022 08:12:33 +0000 (09:12 +0100)
commita829eff05866d7fdf1d414356a2afffab1c3cca0
treee35c681752873c6a183eed3f19babf14ab95195d
parentc90e9c396c917e9495f8f4cc6ac731c9d9fd1b8a
smb: check correct buffer for overflow

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
rust/src/smb/smb.rs