summaryrefslogtreecommitdiffstats
path: root/lib/libbsdstat
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2016-05-16 15:42:59 +0000
committertruckman <truckman@FreeBSD.org>2016-05-16 15:42:59 +0000
commit32ff5d515469718aaf8c9765b22a7e47dffc8578 (patch)
tree6e78f05edbffcff5126f7286b14b8dd6906291fd /lib/libbsdstat
parent1b6b6128018b19619771e899f7157e183b6cb483 (diff)
downloadFreeBSD-src-32ff5d515469718aaf8c9765b22a7e47dffc8578.zip
FreeBSD-src-32ff5d515469718aaf8c9765b22a7e47dffc8578.tar.gz
Fix off by one error in index limit calculation
Reported by: Coverity CID: 1193826
Diffstat (limited to 'lib/libbsdstat')
-rw-r--r--lib/libbsdstat/bsdstat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libbsdstat/bsdstat.c b/lib/libbsdstat/bsdstat.c
index 96fba00..564020e 100644
--- a/lib/libbsdstat/bsdstat.c
+++ b/lib/libbsdstat/bsdstat.c
@@ -53,7 +53,7 @@ bsdstat_setfmt(struct bsdstat *sf, const char *fmt0)
"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;
OpenPOWER on IntegriCloud