summaryrefslogtreecommitdiffstats
path: root/etc/inc/xmlparse.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-04-21 19:53:14 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-04-21 19:53:14 +0000
commit2c1689fd13be42e445154139ad8035b267f63628 (patch)
treedff67e1f76de6aaed21dd9a5f14fbb6da594e94b /etc/inc/xmlparse.inc
parente7e7584bf60ad338a34618b0e35a9a088c3af2b8 (diff)
downloadpfsense-2c1689fd13be42e445154139ad8035b267f63628.zip
pfsense-2c1689fd13be42e445154139ad8035b267f63628.tar.gz
When we iterate through the backup cache we call out to parse the configuration file. This can be fatal if the xml contents is corrupted and the process will die out. Instead of dieing, return -1 and let the process continue since we have further logic to detect these issues and restore a previous configuration, etc.
Diffstat (limited to 'etc/inc/xmlparse.inc')
-rw-r--r--etc/inc/xmlparse.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/etc/inc/xmlparse.inc b/etc/inc/xmlparse.inc
index 5fd5c70..c9b545d 100644
--- a/etc/inc/xmlparse.inc
+++ b/etc/inc/xmlparse.inc
@@ -161,9 +161,10 @@ function parse_xml_config_raw($cffile, $rootobj, $isstring = "false") {
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
- die(sprintf("XML error: %s at line %d\n",
+ log_error(sprintf("XML error: %s at line %d\n",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
+ return -1;
}
}
xml_parser_free($xml_parser);
OpenPOWER on IntegriCloud