From 55ee009aaa650553868509081f2e2c5e2915008c Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 16 Sep 2014 11:03:57 +0200 Subject: src: fix 'describe' command when passing wrong expressions Before this patch: # nft describe tcp foo value expression, datatype inet_proto (Internet protocol) (basetype integer), 8 bits Segmentation fault After this patch: # nft describe tcp foo :1:14-16: Error: syntax error, unexpected string, expecting end of file or newline or semicolon describe tcp foo ^^^ Reported-by: Kevin Fenzi Signed-off-by: Pablo Neira Ayuso --- include/rule.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/rule.h b/include/rule.h index db914068..88aefc69 100644 --- a/include/rule.h +++ b/include/rule.h @@ -218,6 +218,7 @@ extern void set_print_plain(const struct set *s); * @CMD_RENAME: rename object * @CMD_EXPORT: export the ruleset in a given format * @CMD_MONITOR: event listener + * @CMD_DESCRIBE: describe an expression */ enum cmd_ops { CMD_INVALID, @@ -230,6 +231,7 @@ enum cmd_ops { CMD_RENAME, CMD_EXPORT, CMD_MONITOR, + CMD_DESCRIBE, }; /** @@ -243,6 +245,7 @@ enum cmd_ops { * @CMD_OBJ_CHAIN: chain * @CMD_OBJ_TABLE: table * @CMD_OBJ_RULESET: ruleset + * @CMD_OBJ_EXPR: expression */ enum cmd_obj { CMD_OBJ_INVALID, @@ -253,6 +256,7 @@ enum cmd_obj { CMD_OBJ_CHAIN, CMD_OBJ_TABLE, CMD_OBJ_RULESET, + CMD_OBJ_EXPR, }; /** -- cgit v1.2.3