From e703feeae20af8d97c947612559c0c7b518ba914 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 25 Feb 2022 14:07:22 -0700 Subject: [PATCH] sudo_regex_compile_v1 stub: set errstr on error --- logsrvd/regress/fuzz/fuzz_logsrvd_conf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/logsrvd/regress/fuzz/fuzz_logsrvd_conf.c b/logsrvd/regress/fuzz/fuzz_logsrvd_conf.c index f4b12f39b..d90fa53c1 100644 --- a/logsrvd/regress/fuzz/fuzz_logsrvd_conf.c +++ b/logsrvd/regress/fuzz/fuzz_logsrvd_conf.c @@ -53,8 +53,10 @@ sudo_regex_compile_v1(void *v, const char *pattern, const char **errstr) { regex_t *preg = v; - if (strlen(pattern) > 32) + if (strlen(pattern) > 32) { + *errstr = "invalid regular expression"; return false; + } /* hopefully avoid regfree() crashes */ memset(preg, 0, sizeof(*preg));