]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
rule: fix crash in set listing
authorAna Rey <anarey@gmail.com>
Tue, 8 Apr 2014 08:19:41 +0000 (10:19 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 8 Apr 2014 08:28:20 +0000 (10:28 +0200)
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 <anarey@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/rule.c

index 00dedf547108f73d4902efc2fa50bc84bb1d7d3c..18ae6b13e778fbd0b351c8f2fafed9c57e9e86d4 100644 (file)
@@ -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;