mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 05:21:31 +00:00
Merge pull request #7047 from qlyoung/fix-zlog-target-null-deref
lib: fix possible null dereference in zlog
This commit is contained in:
commit
000ce30ee5
@ -225,10 +225,11 @@ static bool zlog_file_cycle(struct zlog_cfg_file *zcf)
|
||||
zlt->zt.logfn_sigsafe = zlog_fd_sigsafe;
|
||||
} while (0);
|
||||
|
||||
old = zlog_target_replace(&zcf->active->zt, &zlt->zt);
|
||||
old = zlog_target_replace(zcf->active ? &zcf->active->zt : NULL,
|
||||
zlt ? &zlt->zt : NULL);
|
||||
zcf->active = zlt;
|
||||
|
||||
zlog_file_target_free(container_of(old, struct zlt_fd, zt));
|
||||
zlog_file_target_free(container_of_null(old, struct zlt_fd, zt));
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user