Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 May 2016 15:43:00 +0000 (UTC)
From:      Don Lewis <truckman@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r299950 - head/lib/libbsdstat
Message-ID:  <201605161543.u4GFh0cS033454@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605161543.u4GFh0cS033454>