From ee2ef874e982577e978c19bed88c55e8b5680a20 Mon Sep 17 00:00:00 2001 From: christos Date: Sat, 28 Jan 2017 15:01:01 +0000 Subject: copy the terminating NUL (njoly) --- sys/compat/linux/common/linux_misc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/compat/linux/common/linux_misc.c') diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c index 9fa1ee51489..ca04fb1447c 100644 --- a/sys/compat/linux/common/linux_misc.c +++ b/sys/compat/linux/common/linux_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_misc.c,v 1.236 2017/01/13 22:45:15 christos Exp $ */ +/* $NetBSD: linux_misc.c,v 1.237 2017/01/28 15:01:01 christos Exp $ */ /*- * Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.236 2017/01/13 22:45:15 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.237 2017/01/28 15:01:01 christos Exp $"); #include #include @@ -788,7 +788,7 @@ again: *((char *)&idb + idb.d_reclen - 1) = bdp->d_type; } memcpy(idb.d_name, bdp->d_name, - MIN(sizeof(idb.d_name), bdp->d_namlen)); + MIN(sizeof(idb.d_name), bdp->d_namlen + 1)); if ((error = copyout((void *)&idb, outp, linux_reclen))) goto out; /* advance past this real entry */ -- cgit