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

mail_parse_errors: allocate the correct amount of space for mail body.

Use strlen(), not sizeof(), on "problem parsing sudoers" since it
is a tranlated string and not a constant.
This was caught by the existing overflow checks.
This commit is contained in:
Todd C. Miller
2022-05-19 09:42:57 -06:00
parent 0ea431e392
commit 0b63af91bb

View File

@@ -803,7 +803,7 @@ mail_parse_errors(void)
}
sudoers_to_eventlog(&evlog, NewArgv, env_get(), sudo_user.uuid_str);
len = sizeof(_("problem parsing sudoers"));
len = strlen(_("problem parsing sudoers")) + 1;
STAILQ_FOREACH(pe, &parse_error_list, entries) {
len += strlen(_(pe->errstr)) + 1;
}