From 836db76ebe55f59c6e52c21296f45f3752fc5cfa Mon Sep 17 00:00:00 2001 From: oetiker Date: Sun, 24 Feb 2008 14:30:34 +0000 Subject: [PATCH] added for for invalid number of ds entries git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@1299 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_restore.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/program/src/rrd_restore.c b/program/src/rrd_restore.c index 42c316c0..dc28a917 100644 --- a/program/src/rrd_restore.c +++ b/program/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); -- 2.30.2