]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
start reading at gdes_c - 1 or we are out of bounds
authorTobias Oetiker <tobi@oetiker.ch>
Tue, 28 Jul 2015 15:38:59 +0000 (17:38 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Tue, 28 Jul 2015 15:38:59 +0000 (17:38 +0200)
src/rrd_graph_helper.c

index 71c5a3a2ca332bf2ce83ac80ee6b6429c7012719..574bd44939058d3ddb5708e764caa75109f6bf5e 100644 (file)
@@ -1127,7 +1127,7 @@ int parse_stack(enum gf_en gf,parsedargs_t*pa,image_desc_t *const im){
   gdp->stack=1;
   /* and try to get the one index before ourselves */
   long i;
-  for (i=im->gdes_c;(gdp->gf==gf)&&(i>=0);i--) {
+  for (i=im->gdes_c-1;(gdp->gf==gf)&&(i>=0);i--) {
     dprintfparsed("trying to process entry %li with type %u\n",i,im->gdes[i].gf);
     switch (im->gdes[i].gf) {
     case GF_LINE: