libgsf r1038 - in trunk: . gsf
- From: mortenw svn gnome org
- To: svn-commits-list gnome org
- Subject: libgsf r1038 - in trunk: . gsf
- Date: Mon, 26 Jan 2009 18:47:59 +0000 (UTC)
Author: mortenw
Date: Mon Jan 26 18:47:59 2009
New Revision: 1038
URL: http://svn.gnome.org/viewvc/libgsf?rev=1038&view=rev
Log:
2009-01-26 Morten Welinder <terra gnome org>
* gsf/gsf-libxml.c (gsf_xml_in_characters): Handle the case where
we get here without being initialized. See 568994.
(gsf_xml_in_end_document): Mark ourselves uninitialized here.
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/gsf/gsf-libxml.c
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Mon Jan 26 18:47:59 2009
@@ -1,5 +1,8 @@
libgsf 1.14.12
+Morten:
+ * Handle malformed xml better. [#568994]
+
--------------------------------------------------------------------------
libgsf 1.14.11
Modified: trunk/gsf/gsf-libxml.c
==============================================================================
--- trunk/gsf/gsf-libxml.c (original)
+++ trunk/gsf/gsf-libxml.c Mon Jan 26 18:47:59 2009
@@ -829,6 +829,9 @@
static void
gsf_xml_in_characters (GsfXMLInInternal *state, xmlChar const *chars, int len)
{
+ if (!state->initialized)
+ return;
+
if (state->pub.node->has_content != GSF_XML_NO_CONTENT)
g_string_append_len (state->pub.content, chars, len);
}
@@ -881,8 +884,14 @@
g_hash_table_destroy (state->ns_prefixes);
state->ns_prefixes = NULL;
- g_return_if_fail (state->pub.node == &state->pub.doc->root_node->pub);
- g_return_if_fail (state->unknown_depth == 0);
+ state->initialized = FALSE;
+
+ if (state->pub.node != &state->pub.doc->root_node->pub) {
+ g_warning ("Document likely damaged.");
+ }
+ if (state->unknown_depth > 0) {
+ g_warning ("Document likely damaged.");
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]