From: Roy Marples Date: Fri, 4 Dec 2015 12:41:25 +0000 (+0000) Subject: Fix 2 NULL de-references, thanks to Christos. X-Git-Tag: v6.10.0~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdf476262263df3c59dac2e17a88693fea78b9b1;p=thirdparty%2Fdhcpcd.git Fix 2 NULL de-references, thanks to Christos. --- diff --git a/common.c b/common.c index 1d51db3f..0f1b013f 100644 --- a/common.c +++ b/common.c @@ -164,7 +164,7 @@ logger(struct dhcpcd_ctx *ctx, int pri, const char *fmt, ...) #endif if ((ctx == NULL || !(ctx->options & DHCPCD_QUIET)) && - (pri < LOG_DEBUG || (ctx->options & DHCPCD_DEBUG))) + (pri < LOG_DEBUG || (ctx && ctx->options & DHCPCD_DEBUG))) { va_list vac; @@ -178,7 +178,7 @@ logger(struct dhcpcd_ctx *ctx, int pri, const char *fmt, ...) } /* Don't send to syslog if dumping leases or testing */ - if (ctx->options & (DHCPCD_DUMPLEASE | DHCPCD_TEST)) + if (ctx && ctx->options & (DHCPCD_DUMPLEASE | DHCPCD_TEST)) goto out; if (ctx && ctx->log_fd != -1) {