diff options
author | marcus <marcus@FreeBSD.org> | 2002-10-10 00:13:36 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2002-10-10 00:13:36 +0800 |
commit | d38e5ce8c547ae975bf992fcdd4e5187125e7768 (patch) | |
tree | 73546014d7e3529fa85a5058f35ff8c7488d48ea | |
parent | 45f2245524f7a04eca4707eb2a6adeddc40fc440 (diff) | |
download | freebsd-ports-gnome-d38e5ce8c547ae975bf992fcdd4e5187125e7768.tar.gz freebsd-ports-gnome-d38e5ce8c547ae975bf992fcdd4e5187125e7768.tar.zst freebsd-ports-gnome-d38e5ce8c547ae975bf992fcdd4e5187125e7768.zip |
Fix a bug in the DTD validation code that caused a seg fault due to freeing
unitialized memory.
-rw-r--r-- | textproc/libxml2/Makefile | 1 | ||||
-rw-r--r-- | textproc/libxml2/files/patch-temp | 55 |
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) { |