]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxt_u32: enclose argument in quotes
authorJan Engelhardt <jengelh@medozas.de>
Mon, 31 Jan 2011 00:43:20 +0000 (01:43 +0100)
committerJan Engelhardt <jengelh@medozas.de>
Mon, 31 Jan 2011 00:45:34 +0000 (01:45 +0100)
Otherwise ip6tables-save piped to ip6tables-restore can cause a parse
error when the expression list is empty.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
extensions/libxt_u32.c

index 054a5b240e01428a523f3f1bdd40bfa397ed7a06..378de0c96b731fb756fd6e0796e6b444933b762c 100644 (file)
@@ -45,6 +45,7 @@ static void u32_dump(const struct xt_u32 *data)
        const struct xt_u32_test *ct;
        unsigned int testind, i;
 
+       putchar('\"');
        for (testind = 0; testind < data->ntests; ++testind) {
                ct = &data->tests[testind];
 
@@ -81,7 +82,7 @@ static void u32_dump(const struct xt_u32 *data)
                                       ct->value[i].max);
                }
        }
-       printf(" ");
+       printf("\" ");
 }
 
 /* string_to_number() is not quite what we need here ... */