diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2016-03-21 16:30:06 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2016-03-22 11:25:53 +0200 |
commit | bbb746fadb7e069c4b4256fa7c8051a1c527f780 (patch) | |
tree | 247ed447d78c30a0c141805f6ec6dd1f2319bccd | |
parent | f4b58a0816f708fa01fa15afdb386c89b5f07d8b (diff) | |
download | connman-bbb746fadb7e069c4b4256fa7c8051a1c527f780.tar.gz |
iptables-unit: Check that the command generated output
Check the very unlinkely case where not output was produced and return
a failure.
-rw-r--r-- | tools/iptables-unit.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/iptables-unit.c b/tools/iptables-unit.c index 301ce6ec..e919aa53 100644 --- a/tools/iptables-unit.c +++ b/tools/iptables-unit.c @@ -41,6 +41,8 @@ static bool assert_rule(const char *table_name, const char *rule) lines = g_strsplit(output, "\n", 0); g_free(output); + if (!lines) + return false; for (i = 0; lines[i]; i++) { DBG("lines[%02d]: %s\n", i, lines[i]); |