kmodloader: fix NULL pointer deref in case m->depends is missing
authorFelix Fietkau <nbd@openwrt.org>
Mon, 7 Mar 2016 16:34:31 +0000 (17:34 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 7 Mar 2016 16:34:32 +0000 (17:34 +0100)
Observed on an invalid module

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
kmodloader.c

index 2dc795e8b18399bec325fd5fb5899b8b55d87d64..ad1f1c0f4f9e7d13cac8905a26dff94f863806df 100644 (file)
@@ -450,7 +450,7 @@ static int deps_available(struct module *m, int verbose)
        char *dep;
        int err = 0;
 
-       if (!strcmp(m->depends, "-") || !strcmp(m->depends, ""))
+       if (!m->depends || !strcmp(m->depends, "-") || !strcmp(m->depends, ""))
                return 0;
 
        dep = m->depends;