diff options
author | Michael Rash <mbr@cipherdyne.org> | 2004-01-05 09:41:50 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2004-01-05 09:41:50 +0000 |
commit | 29cdbd047cdc757aec98db308114c1c250ae0d22 (patch) | |
tree | c76943d18aec1bcc6099fa285fcce8368cb2eb40 /iptables-restore.c | |
parent | 714c88476c4a637d67baaa078a7f13e27709b430 (diff) |
allow embedding of quote character inside quoted string (Michael Rash)
Diffstat (limited to 'iptables-restore.c')
-rw-r--r-- | iptables-restore.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/iptables-restore.c b/iptables-restore.c index c1888ce5..0a5627da 100644 --- a/iptables-restore.c +++ b/iptables-restore.c @@ -4,7 +4,7 @@ * * This code is distributed under the terms of GNU GPL v2 * - * $Id: iptables-restore.c,v 1.25 2003/03/06 11:56:31 laforge Exp $ + * $Id: iptables-restore.c,v 1.26 2003/05/02 15:30:11 laforge Exp $ */ #include <getopt.h> @@ -318,7 +318,11 @@ int main(int argc, char *argv[]) for (curchar = parsestart; *curchar; curchar++) { if (*curchar == '"') { - if (quote_open) { + /* quote_open cannot be true if there + * was no previous character. Thus, + * curchar-1 has to be within bounds */ + if (quote_open && + *(curchar-1) != '\\') { quote_open = 0; *curchar = ' '; } else { |