Ver código fonte

HPCC-9114 XMLParse gives spurious errors on CDATA sections that end ]]]>

The check for termination of a CDATA Section would miss cases with an odd
number of ] at the end.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 anos atrás
pai
commit
87e217ccf9
1 arquivos alterados com 3 adições e 6 exclusões
  1. 3 6
      system/jlib/jptree.cpp

+ 3 - 6
system/jlib/jptree.cpp

@@ -4125,19 +4125,16 @@ protected:
             readNext();
             while (']' == nextChar)
             {
-                char c1 = nextChar;
                 readNext();
-                if (']' == nextChar)
+                while (']' == nextChar)
                 {
-                    char c2 = nextChar;
                     readNext();
                     if ('>' == nextChar)
                         return;
                     else
-                        text.append(c1).append(c2);
+                        text.append(']');
                 }
-                else
-                    text.append(c1);
+                text.append(']');
             }
             text.append(nextChar);
         }