]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
proto: initialize result expression in ethertype_parse()
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 1 Jul 2014 17:40:31 +0000 (19:40 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 14 Jul 2014 10:30:43 +0000 (12:30 +0200)
Otherwise, you may crash in:

nft add rule bridge filter input ether type ip

Reported-by: Alvaro Neira Ayuso <alvaroneay@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/proto.c

index 0a37a658ab475d266ef262f05c042113b733e190..e5f49cb2b0ce4f788c996c4db71b110635a824d3 100644 (file)
@@ -754,6 +754,7 @@ static struct error_record *ethertype_parse(const struct expr *sym,
 {
        struct error_record *erec;
 
+       *res = NULL;
        erec = sym->dtype->basetype->parse(sym, res);
        if (erec != NULL)
                return erec;