Re: [xml] memory corruption on copying XML!? - PATCH
- From: "Oliver Stöneberg" <oliverst online de>
- To: xml gnome org
- Subject: Re: [xml] memory corruption on copying XML!? - PATCH
- Date: Fri, 23 Jul 2004 15:01:12 +0200
Here is a diff against libxml2-2.6.11:
diff -urN p:\libxml2-2.6.11\SAX2.c p:\libxml2-2.6.11_fixed\SAX2.c
--- p:\libxml2-2.6.11\SAX2.c Thu Jul 01 11:06:40 2004
+++ p:\libxml2-2.6.11_fixed\SAX2.c Fri Jul 23 17:06:23 2004
@@ -1704,7 +1704,7 @@
memset(ret, 0, sizeof(xmlNode));
ret->type = XML_TEXT_NODE;
- ret->name = xmlStringText;
+ ret->name = xmlStrdup(xmlStringText);
if (intern == NULL)
ret->content = xmlStrndup(str, len);
else
diff -urN p:\libxml2-2.6.11\tree.c p:\libxml2-2.6.11_fixed\tree.c
--- p:\libxml2-2.6.11\tree.c Mon May 17 05:24:52 2004
+++ p:\libxml2-2.6.11_fixed\tree.c Fri Jul 23 17:07:30 2004
@@ -2332,7 +2332,7 @@
memset(cur, 0, sizeof(xmlNode));
cur->type = XML_TEXT_NODE;
- cur->name = xmlStringText;
+ cur->name = xmlStrdup(xmlStringText);
if (content != NULL) {
cur->content = xmlStrdup(content);
}
@@ -2557,7 +2557,7 @@
memset(cur, 0, sizeof(xmlNode));
cur->type = XML_TEXT_NODE;
- cur->name = xmlStringText;
+ cur->name = xmlStrdup(xmlStringText);
if (content != NULL) {
cur->content = xmlStrndup(content, len);
}
@@ -2608,7 +2608,7 @@
memset(cur, 0, sizeof(xmlNode));
cur->type = XML_COMMENT_NODE;
- cur->name = xmlStringComment;
+ cur->name = xmlStrdup(xmlStringComment);
if (content != NULL) {
cur->content = xmlStrdup(content);
}
@@ -3762,11 +3762,11 @@
ret->doc = doc;
ret->parent = parent;
if (node->name == xmlStringText)
- ret->name = xmlStringText;
+ ret->name = xmlStrdup(xmlStringText);
else if (node->name == xmlStringTextNoenc)
- ret->name = xmlStringTextNoenc;
+ ret->name = xmlStrdup(xmlStringTextNoenc);
else if (node->name == xmlStringComment)
- ret->name = xmlStringComment;
+ ret->name = xmlStrdup(xmlStringComment);
else if (node->name != NULL)
ret->name = xmlStrdup(node->name);
if ((node->type != XML_ELEMENT_NODE) &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]