* [PATCH libnftnl] src: don't set data_len to zero when returning pointers
@ 2016-08-01 12:02 Pablo Neira Ayuso
0 siblings, 0 replies; only message in thread
From: Pablo Neira Ayuso @ 2016-08-01 12:02 UTC (permalink / raw)
To: netfilter-devel
nft already assumes that passing NULL as data_len is valid, otherwise
it crashes. Fix this by leave data_len unset in this specific case.
Fixes: bda7102 ("src: Fix nftnl_*_get_data() to return the real attribute length")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/expr/dynset.c | 1 -
src/set_elem.c | 1 -
2 files changed, 2 deletions(-)
diff --git a/src/expr/dynset.c b/src/expr/dynset.c
index 111bf8c..0eaa409 100644
--- a/src/expr/dynset.c
+++ b/src/expr/dynset.c
@@ -94,7 +94,6 @@ nftnl_expr_dynset_get(const struct nftnl_expr *e, uint16_t type,
*data_len = sizeof(dynset->set_id);
return &dynset->set_id;
case NFTNL_EXPR_DYNSET_EXPR:
- *data_len = 0;
return dynset->expr;
}
return NULL;
diff --git a/src/set_elem.c b/src/set_elem.c
index 4e89210..7908661 100644
--- a/src/set_elem.c
+++ b/src/set_elem.c
@@ -184,7 +184,6 @@ const void *nftnl_set_elem_get(struct nftnl_set_elem *s, uint16_t attr, uint32_t
*data_len = s->user.len;
return s->user.data;
case NFTNL_SET_ELEM_EXPR:
- *data_len = 0;
return s->expr;
}
return NULL;
--
2.1.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-08-01 12:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-01 12:02 [PATCH libnftnl] src: don't set data_len to zero when returning pointers Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).