interface-event: Fix possible out of bounds array access
authorHans Dedecker <dedeckeh@gmail.com>
Mon, 1 Feb 2016 09:56:24 +0000 (10:56 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 1 Feb 2016 10:09:57 +0000 (11:09 +0100)
The array eventnames is of size 3 while the interface_event type may use
the indexes 3 or 4.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
interface-event.c

index cfbc15c2bd5bcf3008a798949b08804e79e2e799..3cdfbdbd9214f00dfd45a84b4ba5ce3ee672dd70 100644 (file)
@@ -30,7 +30,7 @@ static void task_complete(struct uloop_process *proc, int ret);
 static struct uloop_process task = {
        .cb = task_complete,
 };
-static const char * const eventnames[] = {"ifdown", "ifup", "ifupdate"};
+static const char * const eventnames[] = {"ifdown", "ifup", "ifupdate", "free", "reload"};
 
 static void
 run_cmd(const char *ifname, const char *device, enum interface_event event,