mirror of
https://github.com/sudo-project/sudo.git
synced 2025-09-02 07:15:27 +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:
@@ -803,7 +803,7 @@ mail_parse_errors(void)
|
|||||||
}
|
}
|
||||||
sudoers_to_eventlog(&evlog, NewArgv, env_get(), sudo_user.uuid_str);
|
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) {
|
STAILQ_FOREACH(pe, &parse_error_list, entries) {
|
||||||
len += strlen(_(pe->errstr)) + 1;
|
len += strlen(_(pe->errstr)) + 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user