diff options
author | Havoc Pennington <hp@redhat.com> | 2003-03-28 00:01:53 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-03-28 00:01:53 +0000 |
commit | 574c258bc9304d51bf0cdd131a6473e6fc5b477f (patch) | |
tree | 730ae7a634a428282460186d1160f5b21b63db8e | |
parent | 19670f221f0c59089b51d3aa5493b00086b92550 (diff) |
2003-03-27 Havoc Pennington <hp@redhat.com>
* bus/config-loader-libxml.c (bus_config_load): add another error
check
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | bus/config-loader-libxml.c | 11 |
2 files changed, 15 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2003-03-27 Havoc Pennington <hp@redhat.com> + + * bus/config-loader-libxml.c (bus_config_load): add another error + check + 2003-03-26 Anders Carlsson <andersca@codefactory.se> * doc/TODO: diff --git a/bus/config-loader-libxml.c b/bus/config-loader-libxml.c index 74cfd7dc..250fbd2f 100644 --- a/bus/config-loader-libxml.c +++ b/bus/config-loader-libxml.c @@ -78,6 +78,7 @@ bus_config_load (const DBusString *file, const char *filename; BusConfigParser *parser; DBusError tmp_error; + int ret; _DBUS_ASSERT_ERROR_IS_CLEAR (error); @@ -122,7 +123,7 @@ bus_config_load (const DBusString *file, xmlTextReaderSetErrorHandler (reader, xml_text_reader_error, &tmp_error); - while (xmlTextReaderRead (reader) == 1) + while ((ret = xmlTextReaderRead (reader)) == 1) { int type; @@ -142,6 +143,14 @@ bus_config_load (const DBusString *file, * manually handle stuff like < */ } + + if (ret == -1) + { + if (!dbus_error_is_set (&tmp_error)) + dbus_set_error (&tmp_error, + DBUS_ERROR_FAILED, + "Unknown failure loading configuration file"); + } reader_out: xmlFreeTextReader (reader); |