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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to