From: Ana Rey Date: Tue, 8 Apr 2014 08:19:41 +0000 (+0200) Subject: rule: fix crash in set listing X-Git-Tag: v0.2~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=89596a35c4741cb99664e66da438992c2a907a71;p=thirdparty%2Fnftables.git rule: fix crash in set listing It fixes an invalid read that is shown by valgrind. ==3962== Invalid read of size 4 ==3962== at 0x407040: do_command (rule.c:692) ==3962== by 0x40588C: nft_run (main.c:183) ==3962== by 0x405469: main (main.c:334) ==3962== Address 0x10 is not stack'd, malloc'd or (recently) free'd Signed-off-by: Ana Rey Signed-off-by: Pablo Neira Ayuso --- diff --git a/src/rule.c b/src/rule.c index 00dedf54..18ae6b13 100644 --- a/src/rule.c +++ b/src/rule.c @@ -674,7 +674,7 @@ static int do_command_list(struct netlink_ctx *ctx, struct cmd *cmd) return -1; set_print(set); } - break; + return 0; case CMD_OBJ_SET: if (netlink_get_set(ctx, &cmd->handle, &cmd->location) < 0) return -1;