mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-11-24 18:44:10 +08:00
Fix 2 NULL de-references, thanks to Christos.
This commit is contained in:
parent
4830bb6222
commit
fdf4762622
4
common.c
4
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user