]> granicus.if.org Git - libexpat/commitdiff
Avoid undefined behavior when computing larger blockSize. The compiler might reason...
authorPascal Cuoq <cuoq@trust-in-soft.com>
Sun, 15 May 2016 17:11:55 +0000 (19:11 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Mon, 16 May 2016 14:10:57 +0000 (16:10 +0200)
expat/lib/xmlparse.c

index 92fbb1d67672d3350f3b8a2d9b331f3a0d1a66d8..9722f2ec6ebec96f59582d85d5771371f187aa4c 100644 (file)
@@ -6286,7 +6286,7 @@ poolGrow(STRING_POOL *pool)
   }
   if (pool->blocks && pool->start == pool->blocks->s) {
     BLOCK *temp;
-    int blockSize = (int)(pool->end - pool->start)*2;
+    int blockSize = (int)((unsigned)(pool->end - pool->start)*2U);
 
     if (blockSize < 0)
       return XML_FALSE;