Code

prepare for the release of rrdtool-1.2.30
[rrdtool-all.git] / program / src / rrd_restore.c
index 42c316c0f056d7b9d32e19b508dbec7c0d9e71b6..fa0a3b801c71ddc46649a78ddaaa67cfec162ece 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.2.27  Copyright by Tobi Oetiker, 1997-2008
+ * RRDtool 1.2.30  Copyright by Tobi Oetiker, 1997-2009
  *****************************************************************************
  * rrd_restore.c  creates new rrd from data dumped by rrd_dump.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 <ds> entries in <cdp_prep>",rrd->stat_head->ds_cnt);
+            return -1;
+         }
       /* support to read CDP parameters */
       rra_index = rrd->stat_head->rra_cnt-1; 
       skip(&ptr2);