diff options
author | Florian Westphal <fw@strlen.de> | 2018-11-12 18:04:45 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-11-12 18:27:12 +0100 |
commit | 5edb249b25da2d27bca886eb1aa03e6ce65cc8ca (patch) | |
tree | 2a65e04b4c1ecb26f4c1ed20b0d54db1663c2178 /libxtables/xtables.c | |
parent | 9afd2a6e8c547b81a43e6d3565ca5324ba5f5f1e (diff) |
libxtables: xlate: init buffer to zero
Doesn't affect iptables-xlate, but nft (when built w. xtables support).
Without this, nft can print random content if an extension doesn't
add anything to the output xlate buffer, e.g.
-p mh -m mh
can cause nft to print random data after "meta l4proto mobility",
as mh ->xlate doesn't do anything in this case.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'libxtables/xtables.c')
-rw-r--r-- | libxtables/xtables.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libxtables/xtables.c b/libxtables/xtables.c index 11231fc4..ea9bb102 100644 --- a/libxtables/xtables.c +++ b/libxtables/xtables.c @@ -2212,6 +2212,7 @@ struct xt_xlate *xt_xlate_alloc(int size) if (xl->buf.data == NULL) xtables_error(RESOURCE_PROBLEM, "OOM"); + xl->buf.data[0] = '\0'; xl->buf.size = size; xl->buf.rem = size; xl->buf.off = 0; |