]> granicus.if.org Git - libexpat/commitdiff
Fix bug with xml prefix.
authorJames Clark <jjc@jclark.com>
Wed, 5 Jul 2000 10:30:04 +0000 (10:30 +0000)
committerJames Clark <jjc@jclark.com>
Wed, 5 Jul 2000 10:30:04 +0000 (10:30 +0000)
expat/xmlparse/xmlparse.c

index da0cfd48eea10e1affc26b012276c6718f037d9a..d11a1462930bf0cb2ce75c19300cc51bf0e177d3 100755 (executable)
@@ -3376,10 +3376,12 @@ int setContext(XML_Parser parser, const XML_Char *context)
        prefix = (PREFIX *)lookup(&dtd.prefixes, poolStart(&tempPool), sizeof(PREFIX));
        if (!prefix)
          return 0;
-        if (prefix->name == poolStart(&tempPool))
-          poolFinish(&tempPool);
-        else
-         poolDiscard(&tempPool);
+        if (prefix->name == poolStart(&tempPool)) {
+         prefix->name = poolCopyString(&dtd.pool, prefix->name);
+         if (!prefix->name)
+           return 0;
+       }
+       poolDiscard(&tempPool);
       }
       for (context = s + 1; *context != CONTEXT_SEP && *context != XML_T('\0'); context++)
         if (!poolAppendChar(&tempPool, *context))