Make a copy of the current sudoers path when assigning errorfile.

Fixes a potential use after free in visudo when there is an error
in one of the include files.
This commit is contained in:
Todd C. Miller
2016-10-31 15:21:18 -06:00
parent a3a545e416
commit 5a8b60e4b4
5 changed files with 32 additions and 14 deletions

View File

@@ -266,7 +266,7 @@ int pam_prep_user(struct passwd *);
/* gram.y */
int sudoersparse(void);
extern char *login_style;
extern const char *errorfile;
extern char *errorfile;
extern int errorlineno;
extern bool parse_error;
extern bool sudoers_warnings;