On Sun, Sep 28, 2014 at 5:12 PM, <philippedesw...@gmail.com> wrote: > From: Philippe De Swert <philippe.desw...@jollamobile.com> > > Cpu's are assigned normally, so starting at 0, so the MAX_CPU index will > always be one smaller than the actual number. > > Found with Coverity. > --- > src/bootchart/store.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/bootchart/store.c b/src/bootchart/store.c > index 3099ff1..9ea1b27 100644 > --- a/src/bootchart/store.c > +++ b/src/bootchart/store.c > @@ -199,7 +199,7 @@ vmstat_next: > > if (strstr(key, "cpu")) { > r = safe_atoi((const char*)(key+3), &c); > - if (r < 0 || c > MAXCPUS) > + if (r < 0 || c > MAXCPUS -1) > /* Oops, we only have room for MAXCPUS data > */ > break; > sampledata->runtime[c] = atoll(rt); > -- > 1.8.3.2 >
Applied. Thanks. _______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel