]> git.ipfire.org Git - thirdparty/suricata.git/commit
ftp: truncate first segment if over max length
authorJason Ish <jason.ish@oisf.net>
Fri, 22 Apr 2022 18:04:37 +0000 (12:04 -0600)
committerVictor Julien <vjulien@oisf.net>
Tue, 3 May 2022 07:14:28 +0000 (09:14 +0200)
commit8c459af51b21b4ee5faeb3ae7643d01127ac9a25
tree2bad8c51c8c2584902228a2650aec5b41c754666
parentda4a702df21b274afe7dded35544bd37012b7682
ftp: truncate first segment if over max length

The first segment was not limited to the configured maximum line length
allowing it to be up to 65k. This could result in the next input length
being negative, which while handled properly by the code, did trigger a
debug validation assertion.

The fix is to be consistent and apply the limit to the first segment as
well, which does ensure the input_len could never be less than 0.

Ticket #5281

(cherry picked from commit 9645285dff9eb8313db573d8603162a708736236)
src/app-layer-ftp.c