From owner-freebsd-ports Sun Dec 30 3:13:50 2001 Delivered-To: freebsd-ports@freebsd.org Received: from mx1.chesneycorp.com (sdsl-216-36-93-161.dsl.lax.megapath.net [216.36.93.161]) by hub.freebsd.org (Postfix) with SMTP id 7F69B37B41A for ; Sun, 30 Dec 2001 03:13:21 -0800 (PST) Received: (qmail 51456 invoked from network); 30 Dec 2001 11:13:22 -0000 Received: from unknown (HELO mark) (192.168.1.14) by 192.168.1.2 with SMTP; 30 Dec 2001 11:13:22 -0000 From: "Mark Chesney" To: Cc: Subject: FreeBSD Port: mod_php4-4.1.1 Date: Sun, 30 Dec 2001 04:12:52 -0700 Organization: Chesney Corporation Message-ID: <000201c19122$f28850e0$0e01a8c0@mark> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0003_01C190E8.462978E0" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org This is a multi-part message in MIME format. ------=_NextPart_000_0003_01C190E8.462978E0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0004_01C190E8.462978E0" ------=_NextPart_001_0004_01C190E8.462978E0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, Right now xmldocfile() crashes when there are DTD entities in the XML document. The PHP team responded to my bug report that it was fixed in CVS. http://cvs.php.net/cvs.php/php4/ext/domxml/php_domxml.c shows where the bug was fixed in CVS. Attached is a patch I made from the latest CVS that will help fix domxml until the next full-blown release. The patch made xmldocfile() provide the expected behavior. Thanks for your time. Mark ------=_NextPart_001_0004_01C190E8.462978E0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello,

Right now xmldocfile() crashes when there are DTD entities in the XML = document. The PHP team responded to my bug report that it was fixed in CVS. http://c= vs.php.net/cvs.php/php4/ext/domxml/php_domxml.c shows where the bug was fixed in CVS. Attached is a patch I made from = the latest CVS that will help fix domxml until = the next full-blown release. The patch made xmldocfile() provide the expected behavior. Thanks for your = time.

Mark

------=_NextPart_001_0004_01C190E8.462978E0-- ------=_NextPart_000_0003_01C190E8.462978E0 Content-Type: application/octet-stream; name="patch-ext_domxml_php_domxml.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="patch-ext_domxml_php_domxml.c" --- ext/domxml/php_domxml.c.orig Fri Dec 14 03:45:46 2001=0A= +++ ext/domxml/php_domxml.c Sun Dec 30 03:55:10 2001=0A= @@ -16,7 +16,7 @@=0A= = +----------------------------------------------------------------------+=0A= */=0A= =0A= -/* $Id: php_domxml.c,v 1.67.2.9 2001/12/14 10:45:46 mfischer Exp $ */=0A= +/* $Id: php_domxml.c,v 1.90 2001/12/20 14:40:43 mfischer Exp $ */=0A= =0A= =0A= #ifdef HAVE_CONFIG_H=0A= @@ -411,9 +411,14 @@=0A= {=0A= while (node !=3D NULL) {=0A= node_list_wrapper_dtor(node->children);=0A= - // FIXME temporary fix; think of something better=0A= - if (node->type !=3D XML_ATTRIBUTE_DECL && node->type !=3D = XML_DTD_NODE) {=0A= - attr_list_wrapper_dtor(node->properties);=0A= + switch (node->type) {=0A= + /* Skip property freeing for the following types */=0A= + case XML_ATTRIBUTE_DECL:=0A= + case XML_DTD_NODE:=0A= + case XML_ENTITY_DECL:=0A= + break;=0A= + default:=0A= + attr_list_wrapper_dtor(node->properties);=0A= }=0A= node_wrapper_dtor(node);=0A= node =3D node->next;=0A= @@ -817,7 +822,6 @@=0A= xmlNodePtr nodep =3D obj;=0A= object_init_ex(wrapper, domxmlentityref_class_entry);=0A= rsrc_type =3D le_domxmlentityrefp;=0A= - content =3D xmlNodeGetContent(nodep);=0A= add_property_stringl(wrapper, "name", (char *) nodep->name, = strlen(nodep->name), 1);=0A= break;=0A= }=0A= @@ -932,12 +936,12 @@=0A= le_domxmlelementp =3D = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domelement", = module_number);=0A= le_domxmldtdp =3D zend_register_list_destructors_ex(php_free_xml_node, = NULL, "domdtd", module_number);=0A= le_domxmlcdatap =3D = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domcdata", = module_number);=0A= + le_domxmlentityrefp =3D = zend_register_list_destructors_ex(php_free_xml_node, NULL, = "domentityref", module_number);=0A= =0A= /* Not yet initialized le_*s */=0A= le_domxmldoctypep =3D -10000;=0A= le_domxmlpip =3D -10002;=0A= le_domxmlnotationp =3D -10003;=0A= - le_domxmlentityrefp =3D -10004;=0A= =0A= #if defined(LIBXML_XPATH_ENABLED)=0A= le_xpathctxp =3D = zend_register_list_destructors_ex(php_free_xpath_context, NULL, = "xpathcontext", module_number);=0A= @@ -1586,11 +1590,7 @@=0A= zval *id;=0A= xmlNode *nodep;=0A= =0A= - DOMXML_NO_ARGS();=0A= -=0A= - DOMXML_GET_THIS_OBJ(nodep, id, le_domxmlnodep);=0A= -=0A= - DOMXML_NO_ARGS();=0A= + DOMXML_PARAM_NONE(nodep, id, le_domxmlnodep);=0A= =0A= xmlUnlinkNode(nodep);=0A= xmlFreeNode(nodep);=0A= ------=_NextPart_000_0003_01C190E8.462978E0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message