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

Modified Files:
        src/sys/compat/linux32/common: linux32_dirent.c

Log Message:
we have space for one more.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/compat/linux32/common/linux32_dirent.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/linux32/common/linux32_dirent.c
diff -u src/sys/compat/linux32/common/linux32_dirent.c:1.15 src/sys/compat/linux32/common/linux32_dirent.c:1.16
--- src/sys/compat/linux32/common/linux32_dirent.c:1.15	Sat Jan 28 10:08:06 2017
+++ src/sys/compat/linux32/common/linux32_dirent.c	Sat Jan 28 10:09:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_dirent.c,v 1.15 2017/01/28 15:08:06 christos Exp $ */
+/*	$NetBSD: linux32_dirent.c,v 1.16 2017/01/28 15:09:55 christos Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.15 2017/01/28 15:08:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_dirent.c,v 1.16 2017/01/28 15:09:55 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -215,7 +215,7 @@ again:
 			idb.d_off = (linux32_off_t)off;
 			idb.d_reclen = (u_short)linux32_reclen;
 		}
-		size_t l = MIN(sizeof(idb.d_name) - 2, bdp->d_namlen + 1);
+		size_t l = MIN(sizeof(idb.d_name) - 1, bdp->d_namlen + 1);
 		memcpy(idb.d_name, bdp->d_name, l);
 		idb.d_name[l + 1] = bdp->d_type;
 		if ((error = copyout((void *)&idb, outp, linux32_reclen)))

Reply via email to