From: sungta <tadinhsung@gmail.com>
Date: Mon, 23 Oct 2017 14:17:01 +0700
Subject: [8/8] fix replaceChild
Origin: https://github.com/shlomif/perl-XML-LibXML/commit/85dc8d5d4b905b323a46ef7e611d889b1c3375df
Bug-Debian: https://bugs.debian.org/866676
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-10672
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=122246

---
 LibXML.xs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/LibXML.xs b/LibXML.xs
index 718f7db..298ff0d 100644
--- a/LibXML.xs
+++ b/LibXML.xs
@@ -4831,7 +4831,8 @@ replaceChild( self, nNode, oNode )
     CODE:
         // if newNode == oldNode or self == newNode then do nothing, just return nNode.
         if(nNode == oNode || self == nNode ){ 
-          RETVAL = nNode;
+		ret = nNode;
+        	RETVAL = PmmNodeToSv(ret, PmmOWNERPO(PmmPROXYNODE(ret)));
         }
         else{
             if ( self->type == XML_DOCUMENT_NODE ) {
-- 
2.15.0.rc2

