Add basic regress for JSON functions.

Fix a bug in escaped control character handling.
Roll back changes to buffer if sudo_json_add_value() fails.
This commit is contained in:
Todd C. Miller
2022-12-15 19:49:11 -07:00
parent 0e6482e827
commit 797cc917a8
12 changed files with 310 additions and 32 deletions

View File

@@ -880,7 +880,7 @@ format_json(int event_type, struct eventlog_args *args,
debug_return_str(NULL);
}
if (!sudo_json_init(&jsonc, 4, compact, false))
if (!sudo_json_init(&jsonc, 4, compact, false, false))
goto bad;
if (!sudo_json_open_object(&jsonc, type_str))
goto bad;