[gupnp-av/wip/didl-lite-fragments] Fix the crasher fix.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp-av/wip/didl-lite-fragments] Fix the crasher fix.
- Date: Mon, 22 Oct 2012 12:40:12 +0000 (UTC)
commit 2f663c460d50165d7c25f918acadac616847eea4
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 43c0426..6ede416 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]