expr: call expr->ops->snprintf only if defined
Pablo Neira Ayuso
maintainerPATCH 1/1 expr: call expr->ops->snprintf only if defined
The notrack expression comes with no ->ops->snprintf, so skip this from nftnl_expr_snprintf() if not set.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- src/expr.c | 3 +++ 1 file changed, 3 insertions(+)
src/expr.c +3 -0
@@ -281,6 +281,9 @@ int nftnl_expr_snprintf(char *buf, size_t size, const struct nftnl_expr *expr,int ret;unsigned int offset =0 , len = size; +if (!expr->ops->snprintf) +return 0 ; + ret = expr->ops->snprintf (buf+offset, len, type, flags, expr);SNPRINTF_BUFFER_SIZE (ret, size, len, offset);
Signature · 1 line
2.1.4