Date: Sun, 30 Dec 2001 04:12:52 -0700 From: "Mark Chesney" <mark@chesneycorp.com> To: <dirk@FreeBSD.org> Cc: <ports@FreeBSD.org> Subject: FreeBSD Port: mod_php4-4.1.1 Message-ID: <000201c19122$f28850e0$0e01a8c0@mark>
next in thread | raw e-mail | index | archive | help
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 <html xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns=3D"http://www.w3.org/TR/REC-html40"> <head> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Dus-ascii"> <meta name=3DProgId content=3DWord.Document> <meta name=3DGenerator content=3D"Microsoft Word 10"> <meta name=3DOriginator content=3D"Microsoft Word 10"> <link rel=3DFile-List href=3D"cid:filelist.xml@01C190E8.3FD6AAD0"> <!--[if gte mso 9]><xml> <o:OfficeDocumentSettings> <o:DoNotRelyOnCSS/> </o:OfficeDocumentSettings> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:SpellingState>Clean</w:SpellingState> <w:GrammarState>Clean</w:GrammarState> <w:DocumentKind>DocumentEmail</w:DocumentKind> <w:EnvelopeVis/> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} span.EmailStyle17 {mso-style-type:personal-compose; mso-style-noshow:yes; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt; font-family:Arial; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:windowtext;} span.SpellE {mso-style-name:""; mso-spl-e:yes;} span.GramE {mso-style-name:""; mso-gram-e:yes;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */=20 table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";} </style> <![endif]--> </head> <body lang=3DEN-US link=3Dblue vlink=3Dpurple = style=3D'tab-interval:.5in'> <div class=3DSection1> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Hello,<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Right now <span class=3DSpellE><span = class=3DGramE>xmldocfile</span></span><span class=3DGramE>(</span>) crashes when there are DTD entities in the XML = document. The PHP team responded to my bug report that it was fixed in CVS. <a href=3D"http://cvs.php.net/cvs.php/php4/ext/domxml/php_domxml.c">http://c= vs.php.net/cvs.php/php4/ext/domxml/php_domxml.c</a> shows where the bug was fixed in CVS. Attached is a patch I made from = the latest CVS that will help fix <span class=3DSpellE>domxml</span> until = the next full-blown release. The patch made <span class=3DSpellE><span = class=3DGramE>xmldocfile</span></span><span class=3DGramE>(</span>) provide the expected behavior. Thanks for your = time.<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 face=3DArial><span = style=3D'font-size:10.0pt; font-family:Arial'>Mark<o:p></o:p></span></font></p> </div> </body> </html> ------=_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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000201c19122$f28850e0$0e01a8c0>