[gupnp-av/wip/didl-lite-fragments: 10/19] Fix the crasher fix.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gupnp-av/wip/didl-lite-fragments: 10/19] Fix the crasher fix.
- Date: Tue, 23 Oct 2012 14:35:12 +0000 (UTC)
commit fbda6e2f0a7969a87d0fb80e3c2fee28d5022494
Author: Krzesimir Nowak <krnowak openismus com>
Date:   Mon Oct 22 14:36:15 2012 +0200
    Fix the crasher fix.
    
    We should pass 1 to xmlCopyNode to have children copied also. This
    ends up with useless namespace definition in topmost node for now.
 libgupnp-av/gupnp-didl-lite-object.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/libgupnp-av/gupnp-didl-lite-object.c b/libgupnp-av/gupnp-didl-lite-object.c
index 92ecc1c..2ead9a2 100644
--- a/libgupnp-av/gupnp-didl-lite-object.c
+++ b/libgupnp-av/gupnp-didl-lite-object.c
@@ -2724,6 +2724,16 @@ validate_temporary_modification (xmlDocPtr        modified_doc,
         return (xmlSchemaValidateDoc (vdata->valid_context, modified_doc) == 0);
 }
 
+static xmlNodePtr
+copy_node (xmlNodePtr node)
+{
+        xmlNodePtr dup = xmlCopyNode (node, 1);
+
+        /* TODO: remove useless namespace definition. */
+
+        return dup;
+}
+
 static GUPnPDIDLLiteFragmentResult
 apply_temporary_modification (DocNode         *modified,
                               xmlNodePtr       current_node,
@@ -2732,7 +2742,7 @@ apply_temporary_modification (DocNode         *modified,
 {
         xmlNodePtr mod_cur_node = find_node (modified->node,
                                              current_node);
-        xmlNodePtr new_node_copy = xmlCopyNode (new_node, 2);
+        xmlNodePtr new_node_copy = copy_node (new_node);
 
         if (!mod_cur_node) {
                 return GUPNP_DIDL_LITE_FRAGMENT_RESULT_UNKNOWN_ERROR;
@@ -2756,7 +2766,7 @@ apply_temporary_addition (DocNode         *modified,
                           XSDValidateData *vdata)
 {
         xmlNodePtr mod_sibling;
-        xmlNodePtr new_node_copy = xmlCopyNode (new_node, 2);
+        xmlNodePtr new_node_copy = copy_node (new_node);
 
         if (sibling->doc == modified->doc)
                 mod_sibling = sibling;
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]