]> granicus.if.org Git - libexpat/commitdiff
Extend PE allocation test with long entity name
authorRhodri James <rhodri@kynesim.co.uk>
Fri, 10 Mar 2017 15:56:49 +0000 (15:56 +0000)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 22 Jul 2017 19:46:16 +0000 (21:46 +0200)
expat/tests/runtests.c

index 3c0791e2ee404910b86ee5aa47f0bbba74fa302f..ce5330eeea01cf527765fd60215e22aaf9c4d1ee 100644 (file)
@@ -5811,7 +5811,25 @@ external_entity_public(XML_Parser parser,
     const char *text1 =
         "<!ELEMENT doc EMPTY>\n"
         "<!ENTITY % e1 PUBLIC 'foo' 'bar.ent'>\n"
-        "<!ENTITY % e2 '%e1;'>\n"
+        "<!ENTITY % "
+        /* Each line is 64 characters */
+        "ThisIsAStupidlyLongParameterNameIntendedToTriggerPoolGrowth12345"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        " '%e1;'>\n"
         "%e1;\n";
     const char *text2 = "<!ATTLIST doc a CDATA 'value'>";
     const char *text;
@@ -5846,9 +5864,10 @@ START_TEST(test_alloc_public_entity_value)
         /* Repeat certain counts to defeat cached allocations */
         if ((i == 2 && repeat < 2) ||
             (i == 3 && repeat == 2) ||
-            (i == 9 && repeat == 3) ||
-            (i == 18 && repeat == 4) ||
-            (i == 19 && repeat == 5)) {
+            (i == 8 && repeat == 3) ||
+            (i == 9 && repeat == 4) ||
+            (i == 18 && repeat == 5) ||
+            (i == 19 && repeat == 6)) {
             i--;
             repeat++;
         }