]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Make memmove() copy terminating NUL in add_dotlibs() (#4656)
authorJames Jones <jejones3141@gmail.com>
Tue, 9 Aug 2022 22:27:52 +0000 (17:27 -0500)
committerGitHub <noreply@github.com>
Tue, 9 Aug 2022 22:27:52 +0000 (18:27 -0400)
To end up with buffer holding a proper NUL-terminated
string in the common cases, memmove() must move the
name string and its terminating NUL. This may be the
cause underlying CID #1504058, so that it won't need
an annotation...or not.

scripts/jlibtool.c

index 6a8dff74d6ca83a01d2c277d229b8539405198b9..072c01795701e8ffdedeced592c14935b68f1125 100644 (file)
@@ -1417,7 +1417,7 @@ static void add_dotlibs(char *buffer)
        } else {
                name++;
        }
-       memmove(name + 6, name, strlen(name));
+       memmove(name + 6, name, strlen(name) + 1);
        memcpy(name, ".libs/", 6);
 }