diff src/script.h @ 3134:39f1cfa4a739 draft

Fix signed/unsigned warnings in {script,serialize}.h (fixes #1541)
author Matt Corallo <matt@bluematt.me>
date Mon, 02 Jul 2012 16:29:14 +0200 (2012-07-02)
parents 2c65e5d626eb
children bf716647e542
line wrap: on
line diff
--- a/src/script.h
+++ b/src/script.h
@@ -452,7 +452,7 @@
                 memcpy(&nSize, &pc[0], 4);
                 pc += 4;
             }
-            if (end() - pc < nSize)
+            if (end() - pc < 0 || (unsigned int)(end() - pc) < nSize)
                 return false;
             if (pvchRet)
                 pvchRet->assign(pc, pc + nSize);