diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-08-02 10:26:49 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-08-02 10:26:49 +0000 |
commit | 17f50ebc6bff094f95dce54595fa865072011ea8 (patch) | |
tree | 3719fab8c3a9e1b7eb0282af7d84a2800aa6e108 /sbin/dump | |
parent | 9242a74a784638d6d832b211e1455f682a88933b (diff) |
mostly harmless buffer overflow
Diffstat (limited to 'sbin/dump')
-rw-r--r-- | sbin/dump/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/dump/main.c b/sbin/dump/main.c index ce517570476..346b8b04efa 100644 --- a/sbin/dump/main.c +++ b/sbin/dump/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.4 1996/03/21 00:15:37 niklas Exp $ */ +/* $OpenBSD: main.c,v 1.5 1996/08/02 10:26:48 deraadt Exp $ */ /* $NetBSD: main.c,v 1.8 1996/03/15 22:39:32 scottr Exp $ */ /*- @@ -519,10 +519,10 @@ rawname(cp) if (dp == NULL) return (NULL); *dp = '\0'; - (void)strcpy(rawbuf, cp); + (void)strncpy(rawbuf, cp, MAXPATHLEN); *dp = '/'; - (void)strcat(rawbuf, "/r"); - (void)strcat(rawbuf, dp + 1); + (void)strncat(rawbuf, "/r", MAXPATHLEN - 1 - strlen(rawbuf)); + (void)strncat(rawbuf, dp + 1, MAXPATHLEN - 1 - strlen(rawbuf)); return (rawbuf); } |