X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_restore.c;h=f3764dac6ce21042dc38d55778586cbf09198f9d;hb=e6cc0dc23827fc99d276884da138985669c956a2;hp=4371d659c996e78b7dd282d2d42c4d9c811ce9ee;hpb=9106f186793f0bb8ed8b1849a1f6df295eb6b181;p=rrdtool.git diff --git a/src/rrd_restore.c b/src/rrd_restore.c index 4371d65..f3764da 100644 --- a/src/rrd_restore.c +++ b/src/rrd_restore.c @@ -129,6 +129,12 @@ int xml2rrd(char* buf, rrd_t* rrd, char rc){ free(rrd -> stat_head); return -1; } + if (atoi(rrd -> stat_head -> version) < 2) + { + rrd_set_error("Can only restore version >= 2 (Not %s). Dump your rrd using a current rrdtool dump.", rrd -> stat_head -> version ); + free(rrd -> stat_head); + return -1; + } rrd->stat_head->float_cookie = FLOAT_COOKIE; rrd->stat_head->ds_cnt = 0; rrd->stat_head->rra_cnt = 0;