Module Name: src
Committed By: martin
Date: Thu Aug 31 11:34:54 UTC 2017
Modified Files:
src/sys/arch/x86/x86 [netbsd-8]: procfs_machdep.c
Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #247):
sys/arch/x86/x86/procfs_machdep.c: revision 1.16
Check buffer length correctly to not to print a garbage character.
Fixes PR#52352 reported by Yasushi Oshima.
To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.2.1 src/sys/arch/x86/x86/procfs_machdep.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/arch/x86/x86/procfs_machdep.c
diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.15 src/sys/arch/x86/x86/procfs_machdep.c:1.15.2.1
--- src/sys/arch/x86/x86/procfs_machdep.c:1.15 Mon May 15 04:21:14 2017
+++ src/sys/arch/x86/x86/procfs_machdep.c Thu Aug 31 11:34:54 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: procfs_machdep.c,v 1.15 2017/05/15 04:21:14 msaitoh Exp $ */
+/* $NetBSD: procfs_machdep.c,v 1.15.2.1 2017/08/31 11:34:54 martin Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.15 2017/05/15 04:21:14 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.15.2.1 2017/08/31 11:34:54 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -203,7 +203,7 @@ procfs_getcpuinfstr(char *bf, size_t *le
for (CPU_INFO_FOREACH(cii, ci)) {
procfs_getonecpu(i++, ci, bf, &used);
total += used + 1;
- if (used + 1 < size) {
+ if (used + 1 <= size) {
bf += used;
*bf++ = '\n';
size -= used + 1;