Skip to content

Commit

Permalink
netfilter: nf_conntrack_ftp: Fix debug output
Browse files Browse the repository at this point in the history
The find_pattern() debug output was printing the 'skip' character.
This can be a NULL-byte and messes up further pr_debug() output.

Output without the fix:
kernel: nf_conntrack_ftp: Pattern matches!
kernel: nf_conntrack_ftp: Skipped up to `<7>nf_conntrack_ftp: find_pattern `PORT': dlen = 8
kernel: nf_conntrack_ftp: find_pattern `EPRT': dlen = 8

Output with the fix:
kernel: nf_conntrack_ftp: Pattern matches!
kernel: nf_conntrack_ftp: Skipped up to 0x0 delimiter!
kernel: nf_conntrack_ftp: Match succeeded!
kernel: nf_conntrack_ftp: conntrack_ftp: match `172,17,0,100,200,207' (20 bytes at 4150681645)
kernel: nf_conntrack_ftp: find_pattern `PORT': dlen = 8

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Thomas Jarosch authored and Pablo Neira Ayuso committed Aug 27, 2019
1 parent 3cf2f45 commit 3a06902
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_conntrack_ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ static int find_pattern(const char *data, size_t dlen,
i++;
}

pr_debug("Skipped up to `%c'!\n", skip);
pr_debug("Skipped up to 0x%hhx delimiter!\n", skip);

*numoff = i;
*numlen = getnum(data + i, dlen - i, cmd, term, numoff);
Expand Down

0 comments on commit 3a06902

Please sign in to comment.