netfilter: nft_tunnel: ERSPAN_VERSION must not be null
[linux-2.6-microblaze.git] / net / netfilter / nft_tunnel.c
index d89c7c5..5284fcf 100644 (file)
@@ -266,6 +266,9 @@ static int nft_tunnel_obj_erspan_init(const struct nlattr *attr,
        if (err < 0)
                return err;
 
+       if (!tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION])
+                return -EINVAL;
+
        version = ntohl(nla_get_be32(tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION]));
        switch (version) {
        case ERSPAN_VERSION: