]> git.ipfire.org Git - thirdparty/suricata.git/commit
ftp: truncate first segment if over max length 7377/head
authorJason Ish <jason.ish@oisf.net>
Fri, 22 Apr 2022 18:04:37 +0000 (12:04 -0600)
committerVictor Julien <vjulien@oisf.net>
Wed, 4 May 2022 21:08:14 +0000 (23:08 +0200)
commit147334260b418072f21da1df1a26490f53b87546
tree06458954eca695c85333dc2a1189190196abf8fa
parent94b0f15506a404f6eb04a2316beae9bbcacc286a
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