]> granicus.if.org Git - libexpat/commitdiff
Remove speculative test from byte_character_handler().
authorRhodri James <rhodri@kynesim.co.uk>
Tue, 22 Aug 2017 13:59:01 +0000 (14:59 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Tue, 29 Aug 2017 21:13:13 +0000 (23:13 +0200)
byte_character_handler() used to test that the string pointer `s`
passed to it was at the correct offset ino the input buffer.  This
is not guaranteed to be the case, and definitely won't be the case
if the input encoding has a different minimum bytes-per-character
to the internal encoding.

expat/tests/runtests.c

index 0d4e6355d59b5d6192e15ea411746ca5740952ea..698b13250ea056e4f611c340ad09771a02e5d6a2 100644 (file)
@@ -4151,7 +4151,7 @@ typedef struct ByteTestData {
 
 static void
 byte_character_handler(void *userData,
-                       const XML_Char *s,
+                       const XML_Char *UNUSED_P(s),
                        int len)
 {
 #ifdef XML_CONTEXT_BYTES
@@ -4172,8 +4172,6 @@ byte_character_handler(void *userData,
         fail("Character byte index incorrect");
     if (XML_GetCurrentByteCount(parser) != len)
         fail("Character byte count incorrect");
-    if (s != buffer + offset)
-        fail("Buffer position incorrect");
 #else
     (void)userData;
     (void)s;