summaryrefslogtreecommitdiff
path: root/textproc/libxml2
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2002-10-09 16:13:36 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2002-10-09 16:13:36 +0000
commit13b7e1b18c97dac87ba4faa4f6d42853d8bcc3e6 (patch)
treea121e9833bb25cad8db4a28c1d7a848092d9bd4d /textproc/libxml2
parentAdd a patch that allows one to debug XFree86 loadable modules. (diff)
Fix a bug in the DTD validation code that caused a seg fault due to freeing
unitialized memory.
Notes
Notes: svn path=/head/; revision=67698
Diffstat (limited to 'textproc/libxml2')
-rw-r--r--textproc/libxml2/Makefile1
-rw-r--r--textproc/libxml2/files/patch-temp55
2 files changed, 56 insertions, 0 deletions
diff --git a/textproc/libxml2/Makefile b/textproc/libxml2/Makefile
index 28898a484a56..86ef6911cb5c 100644
--- a/textproc/libxml2/Makefile
+++ b/textproc/libxml2/Makefile
@@ -7,6 +7,7 @@
PORTNAME= libxml2
PORTVERSION= 2.4.25
+PORTREVISION= 1
CATEGORIES= textproc gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/${PORTNAME}/2.4
diff --git a/textproc/libxml2/files/patch-temp b/textproc/libxml2/files/patch-temp
new file mode 100644
index 000000000000..8d351d583eb2
--- /dev/null
+++ b/textproc/libxml2/files/patch-temp
@@ -0,0 +1,55 @@
+This patch is from CVS and fixes a seg fault due to some bad memory
+management. This will be fixed in the next release.
+
+--- valid.c.orig Wed Oct 9 12:03:48 2002
++++ valid.c Wed Oct 9 12:06:17 2002
+@@ -4551,9 +4551,9 @@
+ xmlElementPtr elemDecl, int warn, xmlNodePtr parent) {
+ int ret = 1;
+ #ifndef LIBXML_REGEXP_ENABLED
+- xmlNodePtr last = NULL;
++ xmlNodePtr last = NULL, last = NULL, tmp;
+ #endif
+- xmlNodePtr repl = NULL, cur, tmp;
++ xmlNodePtr cur;
+ xmlElementContentPtr cont;
+ const xmlChar *name;
+
+@@ -4571,6 +4571,9 @@
+ } else {
+ xmlRegExecCtxtPtr exec;
+
++ ctxt->nodeMax = 0;
++ ctxt->nodeNr = 0;
++ ctxt->nodeTab = NULL;
+ exec = xmlRegNewExecCtxt(elemDecl->contModel, NULL, NULL);
+ if (exec != NULL) {
+ cur = child;
+@@ -4762,9 +4765,11 @@
+ expr[0] = 0;
+ xmlSnprintfElementContent(expr, 5000, cont, 1);
+ list[0] = 0;
++#ifndef LIBXML_REGEXP_ENABLED
+ if (repl != NULL)
+ xmlSnprintfElements(list, 5000, repl, 1);
+ else
++#endif /* LIBXML_REGEXP_ENABLED */
+ xmlSnprintfElements(list, 5000, child, 1);
+
+ if (name != NULL) {
+@@ -4797,7 +4802,6 @@
+
+ #ifndef LIBXML_REGEXP_ENABLED
+ done:
+-#endif
+ /*
+ * Deallocate the copy if done, and free up the validation stack
+ */
+@@ -4811,6 +4815,7 @@
+ xmlFree(ctxt->vstateTab);
+ ctxt->vstateTab = NULL;
+ }
++#endif
+ ctxt->nodeMax = 0;
+ ctxt->nodeNr = 0;
+ if (ctxt->nodeTab != NULL) {