Module Name:    src
Committed By:   christos
Date:           Sat Jan 28 15:01:01 UTC 2017

Modified Files:
        src/sys/compat/linux/common: linux_file64.c linux_misc.c

Log Message:
copy the terminating NUL (njoly)


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/compat/linux/common/linux_file64.c
cvs rdiff -u -r1.236 -r1.237 src/sys/compat/linux/common/linux_misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_file64.c
diff -u src/sys/compat/linux/common/linux_file64.c:1.57 src/sys/compat/linux/common/linux_file64.c:1.58
--- src/sys/compat/linux/common/linux_file64.c:1.57	Fri Jan 13 17:46:43 2017
+++ src/sys/compat/linux/common/linux_file64.c	Sat Jan 28 10:01:01 2017
@@ -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 */

Index: src/sys/compat/linux/common/linux_misc.c
diff -u src/sys/compat/linux/common/linux_misc.c:1.236 src/sys/compat/linux/common/linux_misc.c:1.237
--- src/sys/compat/linux/common/linux_misc.c:1.236	Fri Jan 13 17:45:15 2017
+++ src/sys/compat/linux/common/linux_misc.c	Sat Jan 28 10:01:01 2017
@@ -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 */

Reply via email to