diff options
author | Phil Sutter <phil@nwl.cc> | 2018-12-20 21:03:31 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-12-21 12:05:16 +0100 |
commit | f8eed54150fd49ed814e63a5db39eda67d4b3938 (patch) | |
tree | 82e6673bfd2e4823d136ea643ed51868fe1d92dd /src | |
parent | 8ef66870832d56881703a7798ecdff9e19917b15 (diff) |
flowtable: Fix for reading garbage
nftnl_flowtable_get_data() doesn't assign to passt data_len pointer
destination in all cases, so initialize it to 0.
Fixes: eb58f53372e74 ("src: add flowtable support")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/flowtable.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/flowtable.c b/src/flowtable.c index 31b3c1b..1f7ba30 100644 --- a/src/flowtable.c +++ b/src/flowtable.c @@ -245,7 +245,7 @@ EXPORT_SYMBOL(nftnl_flowtable_get_str); uint32_t nftnl_flowtable_get_u32(const struct nftnl_flowtable *c, uint16_t attr) { - uint32_t data_len; + uint32_t data_len = 0; const uint32_t *val = nftnl_flowtable_get_data(c, attr, &data_len); nftnl_assert(val, attr, data_len == sizeof(uint32_t)); @@ -256,7 +256,7 @@ EXPORT_SYMBOL(nftnl_flowtable_get_u32); int32_t nftnl_flowtable_get_s32(const struct nftnl_flowtable *c, uint16_t attr) { - uint32_t data_len; + uint32_t data_len = 0; const int32_t *val = nftnl_flowtable_get_data(c, attr, &data_len); nftnl_assert(val, attr, data_len == sizeof(int32_t)); |