From: Alan T. DeKok Date: Tue, 29 Aug 2023 00:38:13 +0000 (-0400) Subject: more "shut up static analysis" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c68b95f1b29b4f3907d6361c0fbbd5503bda55f;p=thirdparty%2Ffreeradius-server.git more "shut up static analysis" --- diff --git a/src/lib/util/regex.c b/src/lib/util/regex.c index 1143dcd8a37..be1040cd49b 100644 --- a/src/lib/util/regex.c +++ b/src/lib/util/regex.c @@ -359,10 +359,6 @@ int regex_exec(regex_t *preg, char const *subject, size_t len, fr_regmatch_t *re * fails when passed NULL match data. */ if (!regmatch) { -#ifdef STATIC_ANALYZER - if (!preg->compiled) return -1; -#endif - match_data = pcre2_match_data_create_from_pattern(preg->compiled, fr_pcre2_tls->gcontext); if (!match_data) { fr_strerror_const("Failed allocating temporary match data"); diff --git a/src/lib/util/regex.h b/src/lib/util/regex.h index 1b1b83d31ac..a04d1583f2f 100644 --- a/src/lib/util/regex.h +++ b/src/lib/util/regex.h @@ -176,7 +176,7 @@ ssize_t regex_flags_print(fr_sbuff_t *sbuff, fr_regex_flags_t const *flags); ssize_t regex_compile(TALLOC_CTX *ctx, regex_t **out, char const *pattern, size_t len, fr_regex_flags_t const *flags, bool subcaptures, bool runtime); -int regex_exec(regex_t *preg, char const *subject, size_t len, fr_regmatch_t *regmatch); +int regex_exec(regex_t *preg, char const *subject, size_t len, fr_regmatch_t *regmatch) CC_HINT(nonnull(1,2)); #ifdef HAVE_REGEX_PCRE2 int regex_substitute(TALLOC_CTX *ctx, char **out, size_t max_out, regex_t *preg, fr_regex_flags_t *flags, char const *subject, size_t subject_len,