Index: amaya/Xml2thot.c =================================================================== RCS file: /sources/public/Amaya/amaya/Xml2thot.c,v retrieving revision 1.477 diff -c -r1.477 Xml2thot.c --- amaya/Xml2thot.c 7 Apr 2009 12:27:38 -0000 1.477 +++ amaya/Xml2thot.c 8 Apr 2009 14:10:52 -0000 @@ -282,7 +282,12 @@ while (!found && CurrentParserCtxt != NULL) { - if (!strcmp (CurrentParserCtxt->UriName, Template_URI)) + if (!CurrentParserCtxt->UriName) + { + /* If UriName is NULL, none of the below cases could match. + Prevent a segfault by not comparing. */ + } + else if (!strcmp (CurrentParserCtxt->UriName, Template_URI)) { /* Templates */ if (!strcmp ((char *)uriName, Template_URI) || @@ -3179,7 +3184,7 @@ attrName = (char *)TtaStrdup ((char *)ptr); if (UnknownNS) CurrentParserCtxt = NULL; - if (CurrentParserCtxt && + if (CurrentParserCtxt && CurrentParserCtxt->UriName && strcmp ((char *)nsURI, (char *)CurrentParserCtxt->UriName) && ChangeXmlParserContextByUri (nsURI)) {