]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Use memmove(3) to avoid overlapping copy.
authorbdrewery <bdrewery@FreeBSD.org>
Thu, 29 Oct 2015 23:06:33 +0000 (23:06 +0000)
committerbdrewery <bdrewery@FreeBSD.org>
Thu, 29 Oct 2015 23:06:33 +0000 (23:06 +0000)
Reported by: valgrind
MFC after: 2 weeks
X-MFC-With: r290168

lib/libc/iconv/citrus_esdb.c

index 578cbc1a06479ea91269bd5d20440cee332acf18..ed404a6a6bd242909023707c1190469e05df3afd 100644 (file)
@@ -328,7 +328,7 @@ _citrus_esdb_get_list(char ***rlist, size_t *rnum, bool sorted)
                            (int)_region_size(&data),
                            (const char *)_region_head(&data));
                        if ((p = strchr(buf1, '/')) != NULL)
-                               memcpy(buf1, p + 1, strlen(p) - 1);
+                               memmove(buf1, p + 1, strlen(p) - 1);
                        if ((p = strstr(buf1, ".esdb")) != NULL)
                                *p = '\0';
                        snprintf(buf, sizeof(buf), "%s/%.*s", buf1,