Skip to content

ftp: fix command_data length#1222

Closed
inashivb wants to merge 1 commit intoOISF:masterfrom
inashivb:ftp-possible-test-fix/v1
Closed

ftp: fix command_data length#1222
inashivb wants to merge 1 commit intoOISF:masterfrom
inashivb:ftp-possible-test-fix/v1

Conversation

@inashivb
Copy link
Member

@inashivb inashivb commented May 31, 2023

Given that we cap the long lines at 4096 bytes and command_data.__len is calculated by

request size - (command size + space) (ref: https://github.com/OISF/suricata/blob/master/src/output-json-ftp.c#L61)

which in this case, 4 (RETR) + 1 = 5

The command_data length should be 4091 bytes.

There are issues w the current code that I'm fixing and couldn't get this test to pass and am wondering now if the test is correct. As per my calculations above, test should be updated. Wdyt @jasonish ?

@inashivb inashivb requested a review from jasonish May 31, 2023 07:54
@victorjulien
Copy link
Member

victorjulien commented Jun 5, 2023

PR looks correct to me.

@inashivb inashivb force-pushed the ftp-possible-test-fix/v1 branch from fa165c2 to 21a313d Compare June 5, 2023 14:53
@jasonish
Copy link
Member

jasonish commented Jun 5, 2023

Is this waiting on a Suricata PR?

@victorjulien
Copy link
Member

OISF/suricata#8963

@inashivb
Copy link
Member Author

inashivb commented Jun 9, 2023

Merged via #1233

@inashivb inashivb closed this Jun 9, 2023
@inashivb inashivb deleted the ftp-possible-test-fix/v1 branch June 9, 2023 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments