[Expat-checkins] expat/lib xmlparse.c,1.91,1.92

Fred L. Drake fdrake@users.sourceforge.net
Tue, 08 Oct 2002 10:04:57 -0700


Update of /cvsroot/expat/expat/lib
In directory usw-pr-cvs1:/tmp/cvs-serv11082/lib

Modified Files:
	xmlparse.c 
Log Message:
SF bug #620343: segfault: bad API/callback interaction
The start-namespace-decl callback can set the start-element callback to
NULL, but Expat tried to call it anyway.


Index: xmlparse.c
===================================================================
RCS file: /cvsroot/expat/expat/lib/xmlparse.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- xmlparse.c	3 Oct 2002 19:41:26 -0000	1.91
+++ xmlparse.c	8 Oct 2002 17:04:55 -0000	1.92
@@ -2075,8 +2075,9 @@
           result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings));
           if (result)
             return result;
-          startElementHandler(handlerArg, tag->name.str,
-                              (const XML_Char **)atts);
+          if (startElementHandler)
+            startElementHandler(handlerArg, tag->name.str,
+                                (const XML_Char **)atts);
         }
         else if (defaultHandler)
           reportDefault(parser, enc, s, next);