Use memmove(3) to avoid overlapping copy.
Reported by: valgrind MFC after: 2 weeks X-MFC-With: r290168
This commit is contained in:
parent
d8a7885b36
commit
277a765cf4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=290169
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user