expr: missing offset handling for snprintf() in hash and numgen
Pablo Neira Ayuso
maintainerPATCH 1/1 expr: missing offset handling for snprintf() in hash and numgen
Fix incorrect output when offset attribute is unset.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- src/expr/hash.c | 2 +- src/expr/numgen.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
src/expr/hash.c +1 -1
@@ -220,7 +220,7 @@ nftnl_expr_hash_snprintf_default(char *buf, size_t size,SNPRINTF_BUFFER_SIZE (ret, size, len, offset);if (hash->offset) { - ret =snprintf (buf, len,"offset %u " , hash->offset); + ret =snprintf (buf + offset, len,"offset %u " , hash->offset);SNPRINTF_BUFFER_SIZE (ret, size, len, offset); }
src/expr/numgen.c +1 -1
@@ -194,7 +194,7 @@ nftnl_expr_ng_snprintf_default(char *buf, size_t size, }if (ng->offset) { - ret =snprintf (buf, len,"offset %u " , ng->offset); + ret =snprintf (buf + offset, len,"offset %u " , ng->offset);SNPRINTF_BUFFER_SIZE (ret, size, len, offset); }
Signature · 1 line
2.1.4