diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2008-12-13 19:45:53 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2008-12-13 19:45:53 +0100 |
commit | aa36f86194a51c776810ced5c3a6dcead30243fa (patch) | |
tree | 50ed80fc4bfcc9c21791d68fb6a9810d223a813c /src/sync-mode.c | |
parent | 08f59121eb907802d490601f5e54dcd0fbc1d695 (diff) | |
download | conntrack-tools-aa36f86194a51c776810ced5c3a6dcead30243fa.tar.gz conntrack-tools-aa36f86194a51c776810ced5c3a6dcead30243fa.zip |
sync-mode: check if message type is >= NET_T_STATE_MAX before parsing
This patch adds a message-type checking before we parse the message.
Thus, we skip the parsing of messages with bad types.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/sync-mode.c')
-rw-r--r-- | src/sync-mode.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sync-mode.c b/src/sync-mode.c index b2b78ad..6aad8f7 100644 --- a/src/sync-mode.c +++ b/src/sync-mode.c @@ -59,6 +59,11 @@ static void do_mcast_handler_step(struct nethdr *net, size_t remain) break; } + if (net->type > NET_T_STATE_MAX) { + STATE(malformed)++; + dlog(LOG_ERR, "bad state message type"); + return; + } memset(ct, 0, sizeof(__ct)); if (parse_payload(ct, net, remain) == -1) { |