summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-10-15 17:18:20 +0200
committerSteven Barth <steven@midlink.org>2013-10-15 17:18:20 +0200
commit491200f3ffae5c9599124e0b2eccbdf566de4cf4 (patch)
treecd0b7ed237506ce7e1f1cefdd0951867651a2210 /src
parent7fd9d455c7f0d19a87f97ce11942d532c71de05f (diff)
Fix illegal memory access
Diffstat (limited to 'src')
-rw-r--r--src/config.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index 7700c7e..5d29173 100644
--- a/src/config.c
+++ b/src/config.c
@@ -287,7 +287,9 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
if (!iface->ifname[0] && !ifname)
return -1;
- strncpy(iface->ifname, ifname, sizeof(iface->ifname) - 1);
+ if (ifname)
+ strncpy(iface->ifname, ifname, sizeof(iface->ifname) - 1);
+
iface->inuse = true;
if (overwrite)