Re: [xml] xmlParseDTD breaks now

Date view Thread view Subject view Author view

From: Joe McAlerney (joey@silicondefense.com)
Date: Tue Sep 26 2000 - 17:46:32 EDT


Daniel Veillard wrote:
>
> On Tue, Sep 26, 2000 at 01:49:42PM -0700, Joe McAlerney wrote:
> >
> > Hello,
> >
> > After upgrading from 2.2.2 to 2.2.3, I found that my DOM application was
> > halting when it called xmlParseDTD.
> > Here is the way I call it:
> >
> > dtd = xmlParseDTD("example.dtd","example.dtd");
> >
> > Please bare with me as I drag you through my thinking/debugging process.
> >
> > The specific place it halts, is buried down in resolveEntity() in the
> > file SAX.c. xmlParseDTD calls xmlSAXParseDTD, which initializes a new
> > xmlParserCtxt, and passes it's userdata ptr into resolveEntity, along
> > with my ExternalID and SystemID.
> >
> > The new version of resolveEntity() attempts to extract a base value from
> > the newly initialized xmlParserCtxt value, but can't because there is
> > nothing to extract. As a result, a NULL value is passed into
> > xmlBuildURI, and a NULL value is returned. Unfortunately, that value is
>
> Hum right I understand, this is a serious problem.
>
> At that point the following should be called
> xmlBuildURI("example.dtd", NULL);
>
> right ?
>
> xmlBuildURI() starts with:
>
> if ((URI == NULL) && (base == NULL))
> return(NULL);
> if (URI == NULL)
> return((xmlChar *) xmlMemStrdup((const char *) base));
>
> a simple fix is to add:
>
> if (base == NULL)
> return((xmlChar *) xmlMemStrdup((const char *) URI);
>
> Could you check taht this solves the problem (i.e. that it was correctly
> analyzed)? thanks.
>
> But I dislike the fact that the URI (and the base in the previous case)
> are not parsed to check that their content is a valid URI ...
> I will try to add this test ...
>
> Daniel

Yes, that worked (with the addition of one more parentheses before the
semicolon).

-Joe M.

----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Sep 26 2000 - 18:43:46 EDT