From: James Jones Date: Tue, 9 Aug 2022 22:27:52 +0000 (-0500) Subject: Make memmove() copy terminating NUL in add_dotlibs() (#4656) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4dce551624dbdddb440ee82c627a037c9c9c9bbb;p=thirdparty%2Ffreeradius-server.git Make memmove() copy terminating NUL in add_dotlibs() (#4656) 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. --- diff --git a/scripts/jlibtool.c b/scripts/jlibtool.c index 6a8dff74d6c..072c0179570 100644 --- a/scripts/jlibtool.c +++ b/scripts/jlibtool.c @@ -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); }