From: Arran Cudbard-Bell Date: Sun, 11 Dec 2022 21:51:41 +0000 (-0600) Subject: CID 1469156 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce6f0c778a365e52ecc242529259be1ee4d0011d;p=thirdparty%2Ffreeradius-server.git CID 1469156 --- diff --git a/scripts/build/dlopen.c b/scripts/build/dlopen.c index 338af1e5bf8..9775aaa6aca 100644 --- a/scripts/build/dlopen.c +++ b/scripts/build/dlopen.c @@ -591,9 +591,15 @@ static void ad_have_feature(char const *symbol) def = malloc(5 + sizeof(ad_define_t) + len + 2 + 1); if (!def) return; - memcpy(def->name, "HAVE_", 5); - memcpy(def->name + 5, symbol, len); - memcpy(def->name + 5 + len, "=1", 3); + p = def->name; + memcpy(p, "HAVE_", 5); + p += 5; + memcpy(p, symbol, len); + p += len; + memcpy(p, "=1", 2); + p += 2; + + *p = '\0'; /* gets strcmp'd later */ for (p = def->name + 5; *p != '\0'; p++) { if (islower((int) *p)) { @@ -615,7 +621,6 @@ static void ad_have_feature(char const *symbol) for (last = &ad_define_head; *last != NULL; last = &(*last)->next) { if (def->name[5] > (*last)->name[5]) continue; /* avoid strcmp() for the common case */ - /* coverity[string_null] */ if (strcmp(def->name + 5, (*last)->name + 5) > 0) continue; break; }