svn commit: r299950 - head/lib/libbsdstat

Don Lewis truckman at FreeBSD.org
Mon May 16 15:43:01 UTC 2016


Author: truckman
Date: Mon May 16 15:42:59 2016
New Revision: 299950
URL: https://svnweb.freebsd.org/changeset/base/299950

Log:
  Fix off by one error in index limit calculation
  
  Reported by:	Coverity
  CID:		1193826

Modified:
  head/lib/libbsdstat/bsdstat.c

Modified: head/lib/libbsdstat/bsdstat.c
==============================================================================
--- head/lib/libbsdstat/bsdstat.c	Mon May 16 15:37:41 2016	(r299949)
+++ head/lib/libbsdstat/bsdstat.c	Mon May 16 15:42:59 2016	(r299950)
@@ -53,7 +53,7 @@ bsdstat_setfmt(struct bsdstat *sf, const
 				"skipped\n", sf->name, tok);
 			continue;
 		}
-		if (j+3 > (int) sizeof(sf->fmts)) {
+		if (j+4 > (int) sizeof(sf->fmts)) {
 			fprintf(stderr, "%s: not enough room for all stats; "
 				"stopped at %s\n", sf->name, tok);
 			break;


More information about the svn-src-head mailing list