diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-04-05 20:31:37 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-04-07 10:48:55 +0200 |
commit | e7ff8bab1f72c5b45ead02a0e5302359616e5cdc (patch) | |
tree | ebf1c2ee0f3143539f142492c7d4e1c046970f2a /src/table.c | |
parent | a6d9aeb52e3c40bf064c49d869b71a27506c080a (diff) |
src: fix bogus assertion for unset attributes
If you try to obtain an unset attribute, you hit an assertion error
that should not happen. Fix this by checking if the attribute is
unset, otherwise skip the assertion checking.
Now that we have that nft_assert takes the data parameter, we can also
validate if someone is using the setter passing NULL, which is illegal.
So let's add an assertion for that as well.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/table.c')
-rw-r--r-- | src/table.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/table.c b/src/table.c index 7a85b9e..44e9a7b 100644 --- a/src/table.c +++ b/src/table.c @@ -90,7 +90,7 @@ void nft_table_attr_set_data(struct nft_table *t, uint16_t attr, if (attr > NFT_TABLE_ATTR_MAX) return; - nft_assert_validate(nft_table_attr_validate, attr, data_len); + nft_assert_validate(data, nft_table_attr_validate, attr, data_len); switch (attr) { case NFT_TABLE_ATTR_NAME: |