]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix 2 NULL de-references, thanks to Christos.
authorRoy Marples <roy@marples.name>
Fri, 4 Dec 2015 12:41:25 +0000 (12:41 +0000)
committerRoy Marples <roy@marples.name>
Fri, 4 Dec 2015 12:41:25 +0000 (12:41 +0000)
common.c

index 1d51db3f1baf61c47f62dbedd5669673eaa5e196..0f1b013f59cce9e4d1951bf2fa4fdb2a13a55249 100644 (file)
--- 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) {