From: Tobias Oetiker Date: Tue, 22 Jul 2008 15:15:44 +0000 (+0000) Subject: Fix for #167 - rrdcreate is arguably missing a check for 'step>=1' for RRAs with... X-Git-Tag: 1.2.29~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35efdff2621e6727b752588bd54ee774caf728c8;p=thirdparty%2Frrdtool-1.x.git Fix for #167 - rrdcreate is arguably missing a check for 'step>=1' for RRAs with AVERAGE as a CF. I ran into this when specifying 0.6 as a step value, assuming floats were also accepted. Patch attached here. -- Bogdan git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1445 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_create.c b/src/rrd_create.c index d9ab8f48..186b3b40 100644 --- a/src/rrd_create.c +++ b/src/rrd_create.c @@ -312,6 +312,8 @@ rrd_create_r(const char *filename, break; default: rrd.rra_def[rrd.stat_head->rra_cnt].pdp_cnt = atoi(token); + if (atoi(token) < 1) + rrd_set_error("Invalid step: must be >= 1"); break; } break;