]> granicus.if.org Git - libexpat/commitdiff
Extend XML_GetBuffer testing coverage
authorRhodri James <rhodri@kynesim.co.uk>
Tue, 7 Feb 2017 18:05:55 +0000 (18:05 +0000)
committerSebastian Pipping <sebastian@pipping.org>
Sun, 5 Mar 2017 21:54:57 +0000 (22:54 +0100)
expat/tests/runtests.c

index 53f6d936e2f1e5f093d50c0e98fa83d8236e674d..e7b5988706964c12d75bb3ee8c22bcb64e98c365 100644 (file)
@@ -2000,7 +2000,11 @@ START_TEST(test_get_buffer)
     if (XML_GetBuffer(parser, INT_MAX) != NULL)
         fail("INT_MAX buffer not failed");
 
-    /* Now try extending it a more reasonable amount */
+    /* Now try extending it a more reasonable but still too large amount */
+    if (XML_GetBuffer(parser, INT_MAX - 2049) != NULL)
+        fail("INT_MAX- buffer not failed");
+
+    /* Now try extending it a carefully crafted amount */
     if (XML_GetBuffer(parser, 1000) == NULL)
         fail("1000 buffer failed");
 }