From: oetiker Date: Sun, 24 Feb 2008 14:30:34 +0000 (+0000) Subject: added for for invalid number of ds entries X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a5b914028d6ab1f940d4c5a4b04f63a181ab34a1;p=rrdtool.git added for for invalid number of ds entries git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1299 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_restore.c b/src/rrd_restore.c index 42c316c..dc28a91 100644 --- a/src/rrd_restore.c +++ b/src/rrd_restore.c @@ -314,7 +314,10 @@ int xml2rrd(char* buf, rrd_t* rrd, char rc){ eat_tag(&ptr2,"cdp_prep"); for(i=0;i< (int)rrd->stat_head->ds_cnt;i++) { - eat_tag(&ptr2,"ds"); + if (eat_tag(&ptr2, "ds") != 1){ + rrd_set_error("expected to find %lu entries in ",rrd->stat_head->ds_cnt); + return -1; + } /* support to read CDP parameters */ rra_index = rrd->stat_head->rra_cnt-1; skip(&ptr2);