2003-03-27 Havoc Pennington <hp@redhat.com>

* bus/config-loader-libxml.c (bus_config_load): add another error
	check
This commit is contained in:
Havoc Pennington 2003-03-28 00:01:53 +00:00
parent 19670f221f
commit 574c258bc9
2 changed files with 15 additions and 1 deletions

View file

@ -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:

View file

@ -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 &lt;
*/
}
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);