2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Initialize sudo_conv and sudo_printf in sudoers_audit_open().

We will need them if there is an error parsing sudoers and leaving
them unset can result in NULL deref.  Also set the text domain to
"sudoers" like we do for the policy and I/O logging open functions.
Bug #934.
This commit is contained in:
Todd C. Miller
2020-07-12 10:13:53 -06:00
parent 1e4ce8525a
commit ac00a07018

View File

@@ -135,6 +135,11 @@ sudoers_audit_open(unsigned int version, sudo_conv_t conversation,
int ret;
debug_decl(sudoers_audit_open, SUDOERS_DEBUG_PLUGIN);
sudo_conv = conversation;
sudo_printf = plugin_printf;
bindtextdomain("sudoers", LOCALEDIR);
/* Initialize the debug subsystem. */
for (cur = settings; (cp = *cur) != NULL; cur++) {
if (strncmp(cp, "debug_flags=", sizeof("debug_flags=") - 1) == 0) {