diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2019-02-06 13:26:14 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2019-02-06 13:26:14 +0000 |
commit | fb1808916c9edb494bbfe6c3ad514ab03f2e40a9 (patch) | |
tree | 1aa126c107586a94de2a5d6115142d741ab36c43 /sbin | |
parent | 9fbf37e97719cd216b4175b146a728b64683a1c2 (diff) |
Replace overlapping memcpy() with memmove() in getpathname().
Found the hard way and OK tb@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/fsck_ffs/utilities.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/fsck_ffs/utilities.c b/sbin/fsck_ffs/utilities.c index dc1e9fa6680..663c4a9dcc2 100644 --- a/sbin/fsck_ffs/utilities.c +++ b/sbin/fsck_ffs/utilities.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utilities.c,v 1.51 2015/10/15 03:10:05 deraadt Exp $ */ +/* $OpenBSD: utilities.c,v 1.52 2019/02/06 13:26:13 millert Exp $ */ /* $NetBSD: utilities.c,v 1.18 1996/09/27 22:45:20 christos Exp $ */ /* @@ -494,7 +494,7 @@ getpathname(char *namebuf, size_t namebuflen, ino_t curdir, ino_t ino) break; len = strlen(namebuf); cp -= len; - memcpy(cp, namebuf, (size_t)len); + memmove(cp, namebuf, (size_t)len); *--cp = '/'; if (cp < &namebuf[MAXNAMLEN]) break; @@ -503,7 +503,7 @@ getpathname(char *namebuf, size_t namebuflen, ino_t curdir, ino_t ino) busy = 0; if (ino != ROOTINO) *--cp = '?'; - memcpy(namebuf, cp, (size_t)(&namebuf[PATH_MAX] - cp)); + memmove(namebuf, cp, (size_t)(&namebuf[PATH_MAX] - cp)); } /*ARGSUSED*/ |