From: Arran Cudbard-Bell Date: Sat, 1 Jun 2024 01:32:27 +0000 (-0600) Subject: Fixes to section cmp functions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0c9c608db4d56b9e1226fa27b0a6494efc5ea73;p=thirdparty%2Ffreeradius-server.git Fixes to section cmp functions --- diff --git a/src/lib/server/section.h b/src/lib/server/section.h index f16664fdb19..ac10afd2b06 100644 --- a/src/lib/server/section.h +++ b/src/lib/server/section.h @@ -60,6 +60,10 @@ typedef struct { static inline int section_name2_match(section_name_t const *a, section_name_t const *b) { if ((a->name2 == CF_IDENT_ANY) || (b->name2 == CF_IDENT_ANY)) return 1; + if (!a->name2 || !b->name2) { + if (a->name2 == b->name2) return 1; + return 0; + } return (strcmp(a->name2, b->name2) == 0) ? 1 : 0; } @@ -87,6 +91,8 @@ name2: return section_name2_match(a, b); } +int8_t section_name_cmp(void const *one, void const *two); + #ifdef __cplusplus } #endif