]> granicus.if.org Git - libexpat/commitdiff
prologProcessor(): Avoid segfault by making sure "next" is initialized;
authorFred L. Drake, Jr. <fdrake@users.sourceforge.net>
Fri, 16 Nov 2001 20:57:30 +0000 (20:57 +0000)
committerFred L. Drake, Jr. <fdrake@users.sourceforge.net>
Fri, 16 Nov 2001 20:57:30 +0000 (20:57 +0000)
fix suggested by Tim Crook.
This fixes (I think!) SF bug #226514.

Removed extra "break".

expat/lib/xmlparse.c

index 80599cadd336ca77d053226ead324b1f239d8994..9faeab02294f286cda96d0e1b0202d9b85cdf4ab 100644 (file)
@@ -2563,7 +2563,7 @@ prologProcessor(XML_Parser parser,
                const char *end,
                const char **nextPtr)
 {
-  const char *next;
+  const char *next = s;
   int tok = XmlPrologTok(encoding, s, end, &next);
   return doProlog(parser, encoding, s, end, tok, next, nextPtr);
 }
@@ -3474,7 +3474,6 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, int isCdata,
       if (!poolAppend(pool, enc, ptr, next))
        return XML_ERROR_NO_MEMORY;
       break;
-      break;
     case XML_TOK_TRAILING_CR:
       next = ptr + enc->minBytesPerChar;
       /* fall through */