diff --git a/sbin/dump/main.c b/sbin/dump/main.c index 40d668e13e82..db7c41c98178 100644 --- a/sbin/dump/main.c +++ b/sbin/dump/main.c @@ -537,10 +537,10 @@ rawname(cp) if (dp == NULL) return (NULL); *dp = '\0'; - (void)strcpy(rawbuf, cp); + (void)strncpy(rawbuf, cp, MAXPATHLEN - 1); *dp = '/'; - (void)strcat(rawbuf, "/r"); - (void)strcat(rawbuf, dp + 1); + (void)strncat(rawbuf, "/r", strlen(rawbuf) - (MAXPATHLEN - 1)); + (void)strncat(rawbuf, dp + 1, strlen(rawbuf) - (MAXPATHLEN - 1)); return (rawbuf); }