[iptables PATCH trunk7285 6/7] allow empty strings in argument parser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---

 ip6tables-restore.c |   12 +++++-------
 iptables-restore.c  |   12 +++++-------
 2 files changed, 10 insertions(+), 14 deletions(-)


diff --git a/ip6tables-restore.c b/ip6tables-restore.c
index f9d97ef..ff6b989 100644
--- a/ip6tables-restore.c
+++ b/ip6tables-restore.c
@@ -366,14 +366,12 @@ int main(int argc, char *argv[])
 			for (curchar = parsestart; *curchar; curchar++) {
 				char param_buffer[1024];
 
-				if (escaped) {
-					param_buffer[param_len++] = *curchar;
-					escaped = 0;
-					continue;
-				}
-
 				if (quote_open) {
-					if (*curchar == '\\') {
+					if (escaped) {
+						param_buffer[param_len++] = *curchar;
+						escaped = 0;
+						continue;
+					} else if (*curchar == '\\') {
 						escaped = 1;
 						continue;
 					} else if (*curchar == '"') {
diff --git a/iptables-restore.c b/iptables-restore.c
index d0d3bd7..8e1b638 100644
--- a/iptables-restore.c
+++ b/iptables-restore.c
@@ -373,14 +373,12 @@ main(int argc, char *argv[])
 			for (curchar = parsestart; *curchar; curchar++) {
 				char param_buffer[1024];
 
-				if (escaped) {
-					param_buffer[param_len++] = *curchar;
-					escaped = 0;
-					continue;
-				}
-
 				if (quote_open) {
-					if (*curchar == '\\') {
+					if (escaped) {
+						param_buffer[param_len++] = *curchar;
+						escaped = 0;
+						continue;
+					} else if (*curchar == '\\') {
 						escaped = 1;
 						continue;
 					} else if (*curchar == '"') {


-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux