mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 05:48:18 +00:00
sudo_logsrvd: make sure journal exists before writing the alert message.
Fixes a potential NULL dereference when journaling an alert message.
This commit is contained in:
parent
2e957cd43d
commit
d18ee79354
@ -541,7 +541,13 @@ journal_alert(AlertMessage *msg, uint8_t *buf, size_t len,
|
||||
{
|
||||
debug_decl(journal_alert, SUDO_DEBUG_UTIL);
|
||||
|
||||
debug_return_bool(journal_write(buf, len, closure));
|
||||
/* Store message in a journal for later relaying. */
|
||||
if (closure->journal_path == NULL) {
|
||||
if (!journal_create(closure))
|
||||
debug_return_bool(false);
|
||||
}
|
||||
if (!journal_write(buf, len, closure))
|
||||
debug_return_bool(false);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user