From ff7fd58b49a41bf85df492b9f470004d4433800e Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Fri, 1 Mar 2013 11:31:31 +0000 Subject: [PATCH] unlog: Don't overflow cells array cells has a maximum size of MAXCELLS. Doing cells[MAXCELLS] overflows that array. Clamp our maximum number of cells at one below this to avoid the overflow. Caught by coverity (#98551) Change-Id: I45fd8a55e31ad7ea86a996b593359536c7078891 Reviewed-on: http://gerrit.openafs.org/9324 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear --- src/log/unlog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/log/unlog.c b/src/log/unlog.c index f2760aaa7..f9ee1c881 100644 --- a/src/log/unlog.c +++ b/src/log/unlog.c @@ -65,7 +65,7 @@ CommandProc(struct cmd_syndesc *as, void *arock) if (as->parms[0].items) { /* A cell is provided */ for (itp = as->parms[0].items; itp; itp = itp->next) { - if (i > MAXCELLS) { + if (i >= MAXCELLS) { printf ("The maximum number of cells (%d) is exceeded; the rest are ignored\n", MAXCELLS); -- 2.39.5