summaryrefslogtreecommitdiffstats
path: root/src/expr/ct.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2021-03-09 11:14:29 +0100
committerPhil Sutter <phil@nwl.cc>2021-03-15 12:22:56 +0100
commit5819e46b47c331be01c2f417085c516f3f0aded3 (patch)
treecf01f0d7b493d89a13321d706fa18762a3a49ea3 /src/expr/ct.c
parent228e8b1746270ee5c4a41b671a01369c75622587 (diff)
expr: Fix snprintf buffer length updates
Subsequent calls to snprintf() sometimes reuse 'len' variable although they should refer to the updated value in 'remain' instead. Fixes: 676ea569bbe5a ("src: Change parameters of SNPRINTF_BUFFER_SIZE macro.") Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'src/expr/ct.c')
-rw-r--r--src/expr/ct.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/expr/ct.c b/src/expr/ct.c
index 124de9d..1a21c95 100644
--- a/src/expr/ct.c
+++ b/src/expr/ct.c
@@ -230,7 +230,7 @@ nftnl_expr_ct_snprintf_default(char *buf, size_t size,
struct nftnl_expr_ct *ct = nftnl_expr_data(e);
if (e->flags & (1 << NFTNL_EXPR_CT_SREG)) {
- ret = snprintf(buf, size, "set %s with reg %u ",
+ ret = snprintf(buf, remain, "set %s with reg %u ",
ctkey2str(ct->key), ct->sreg);
SNPRINTF_BUFFER_SIZE(ret, remain, offset);
}