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

Parse into a local parse_tree and add missing cleanup.

Since parsed_policy is for the sudoers parser we should declare our own.
This commit is contained in:
Todd C. Miller
2021-02-01 21:04:49 -07:00
parent d3735b98e9
commit 0d34fa4285

View File

@@ -40,6 +40,7 @@ open_sudoers(const char *file, bool doedit, bool *keepopen)
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
{
struct sudoers_parse_tree parse_tree;
FILE *fp;
/* Don't waste time fuzzing tiny inputs. */
@@ -53,7 +54,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
/* Initialize defaults and parse LDIF-format sudoers. */
init_defaults();
sudoers_parse_ldif(&parsed_policy, fp, NULL, true);
init_parse_tree(&parse_tree, NULL, NULL);
sudoers_parse_ldif(&parse_tree, fp, NULL, true);
/* Cleanup. */
free_parse_tree(&parse_tree);
return 0;
}