From 91d7f4f70583e3aab13ae503bdeda97073cedb07 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 14 Jun 2024 19:47:34 -0400 Subject: Fix redaction code to accept NULL pointers in array * And let the caller specify the length of the array of strings to redact. * Redactions now occur directly on authentication strings rather than their command line arguments --- tests/test_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_utils.c') diff --git a/tests/test_utils.c b/tests/test_utils.c index 94b4585..a2fa8c6 100644 --- a/tests/test_utils.c +++ b/tests/test_utils.c @@ -44,7 +44,7 @@ void test_redact_sensitive() { for (size_t i = 0; i < sizeof(data) / sizeof(*data); i++) { char *input = strdup(data[i]); char output[100] = {0}; - redact_sensitive(to_redact, input, output, sizeof(output) - 1); + redact_sensitive(to_redact, sizeof(to_redact) / sizeof(*to_redact), input, output, sizeof(output) - 1); OMC_ASSERT(strcmp(output, expected[i]) == 0, "incorrect redaction"); } } -- cgit