diff options
| author | christos <christos@NetBSD.org> | 2017-01-28 15:01:01 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2017-01-28 15:01:01 +0000 |
| commit | ee2ef874e982577e978c19bed88c55e8b5680a20 (patch) | |
| tree | ba73c561356a9a12dcf929a0a984de9d6665478d /sys/compat/linux/common | |
| parent | 338a00dc0e25436da29060035cc3e012e87c9e91 (diff) | |
copy the terminating NUL (njoly)
Diffstat (limited to 'sys/compat/linux/common')
| -rw-r--r-- | sys/compat/linux/common/linux_file64.c | 6 | ||||
| -rw-r--r-- | sys/compat/linux/common/linux_misc.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/compat/linux/common/linux_file64.c b/sys/compat/linux/common/linux_file64.c index 40823c79e8f..e54db931de4 100644 --- a/sys/compat/linux/common/linux_file64.c +++ b/sys/compat/linux/common/linux_file64.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_file64.c,v 1.57 2017/01/13 22:46:43 christos Exp $ */ +/* $NetBSD: linux_file64.c,v 1.58 2017/01/28 15:01:01 christos Exp $ */ /*- * Copyright (c) 1995, 1998, 2000, 2008 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.57 2017/01/13 22:46:43 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.58 2017/01/28 15:01:01 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -355,7 +355,7 @@ again: idb.d_off = off; idb.d_reclen = (u_short)linux_reclen; memcpy(idb.d_name, bdp->d_name, MIN(sizeof(idb.d_name), - bdp->d_namlen)); + bdp->d_namlen + 1)); if ((error = copyout((void *)&idb, outp, linux_reclen))) goto out; /* advance past this real entry */ 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 <sys/cdefs.h> -__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 <sys/param.h> #include <sys/systm.h> @@ -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 */ |
