Fix 2 NULL de-references, thanks to Christos.

This commit is contained in:
Roy Marples 2015-12-04 12:41:25 +00:00
parent 4830bb6222
commit fdf4762622

View File

@ -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) {