Skip to content

ftp: fix command_data length - #1222

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

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

Conversation

@inashivb

@inashivb inashivb commented May 31, 2023

Copy link
Copy Markdown
Member

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

victorjulien commented Jun 5, 2023

Copy link
Copy Markdown
Member

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

jasonish commented Jun 5, 2023

Copy link
Copy Markdown
Member

Is this waiting on a Suricata PR?

@victorjulien

Copy link
Copy Markdown
Member

OISF/suricata#8963

@inashivb

inashivb commented Jun 9, 2023

Copy link
Copy Markdown
Member Author

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