diff options
author | Florian Westphal <fw@strlen.de> | 2023-12-15 13:04:22 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2023-12-19 12:04:52 +0100 |
commit | c9f934ca446de5041ce6f19e4ee6a0c74b120186 (patch) | |
tree | 75a8e01db7ad8ead683f6867bf44458b24ffc4a2 /src | |
parent | dd105cb8adc8c9ece0f23fcd21f92b6839b8650a (diff) |
tcpopt: don't create exthdr expression without datatype
The reproducer crashes during concat evaluation, as the
exthdr expression lacks a datatype.
This should never happen, i->dtype must be set.
In this case the culprit is tcp option parsing, it will
wire up a non-existent template, because the "nop" option
has no length field (1 byte only).
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/tcpopt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tcpopt.c b/src/tcpopt.c index 8111a507..f977e417 100644 --- a/src/tcpopt.c +++ b/src/tcpopt.c @@ -224,7 +224,7 @@ struct expr *tcpopt_expr_alloc(const struct location *loc, } tmpl = &desc->templates[field]; - if (!tmpl) + if (!tmpl || !tmpl->dtype) return NULL; expr = expr_alloc(loc, EXPR_EXTHDR, tmpl->dtype, |