From: Felix Fietkau Date: Mon, 7 Mar 2016 16:34:31 +0000 (+0100) Subject: kmodloader: fix NULL pointer deref in case m->depends is missing X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fd4bb41ee7ab136d25609c2a917beea5d52b723b;p=project%2Fubox.git kmodloader: fix NULL pointer deref in case m->depends is missing Observed on an invalid module Signed-off-by: Felix Fietkau --- diff --git a/kmodloader.c b/kmodloader.c index 2dc795e..ad1f1c0 100644 --- a/kmodloader.c +++ b/kmodloader.c @@ -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;