From dbed417dabd1b0096af5eb7020681e7291bd8b84 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Wed, 19 Nov 2003 15:28:21 +0000 Subject: [PATCH] Off by one error in malloc. Approved by: re@ --- usr.sbin/mtree/spec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/mtree/spec.c b/usr.sbin/mtree/spec.c index 1e2655939a8..0407f78cfa2 100644 --- a/usr.sbin/mtree/spec.c +++ b/usr.sbin/mtree/spec.c @@ -238,7 +238,7 @@ set(char *t, NODE *ip) lineno, val); break; case F_SLINK: - ip->slink = malloc(strlen(val)); + ip->slink = malloc(strlen(val) + 1); if (ip->slink == NULL) errx(1, "malloc"); if (strunvis(ip->slink, val) == -1)