When trying to decode payload header fields, be sure to bail out
when having exhausted all available templates.
Otherwise, we allocate invalid payload expressions (no dataype,
header length of 0) and then crash when trying to print them.
Fixes: https://bugzilla.netfilter.org/show_bug.cgi?id=1226
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
for (i = 1; i < array_size(desc->templates); i++) {
tmpl = &desc->templates[i];
+
+ if (tmpl->len == 0)
+ break;
+
if (tmpl->offset != expr->payload.offset)
continue;