Index: setup.nsi
===================================================================
--- setup.nsi	(revision 197)
+++ setup.nsi	(revision 198)
@@ -7,7 +7,7 @@
 
 # General Symbol Definitions
 !define REGKEY "SOFTWARE\$(^Name)"
-!define VERSION 0.3.17
+!define VERSION 0.3.18
 !define COMPANY "Bitcoin project"
 !define URL http://www.bitcoin.org/
 
@@ -42,12 +42,12 @@
 !insertmacro MUI_LANGUAGE English
 
 # Installer attributes
-OutFile bitcoin-0.3.17-win32-setup.exe
+OutFile bitcoin-0.3.18-win32-setup.exe
 InstallDir $PROGRAMFILES\Bitcoin
 CRCCheck on
 XPStyle on
 ShowInstDetails show
-VIProductVersion 0.3.17.0
+VIProductVersion 0.3.18.0
 VIAddVersionKey ProductName Bitcoin
 VIAddVersionKey ProductVersion "${VERSION}"
 VIAddVersionKey CompanyName "${COMPANY}"
Index: script.h
===================================================================
--- script.h	(revision 197)
+++ script.h	(revision 198)
@@ -599,6 +599,8 @@
 
     bool IsPushOnly() const
     {
+        if (size() > 200)
+            return false;
         const_iterator pc = begin();
         while (pc < end())
         {
Index: serialize.h
===================================================================
--- serialize.h	(revision 197)
+++ serialize.h	(revision 198)
@@ -25,7 +25,7 @@
 class CAutoFile;
 static const unsigned int MAX_SIZE = 0x02000000;
 
-static const int VERSION = 31705;
+static const int VERSION = 31800;
 static const char* pszSubVer = "";
 
 
Index: script.cpp
===================================================================
--- script.cpp	(revision 197)
+++ script.cpp	(revision 198)
@@ -997,7 +997,7 @@
                 break;
             if (opcode2 == OP_PUBKEY)
             {
-                if (vch1.size() < 33)
+                if (vch1.size() < 33 || vch1.size() > 120)
                     break;
                 vSolutionRet.push_back(make_pair(opcode2, vch1));
             }
Index: util.cpp
===================================================================
--- util.cpp	(revision 197)
+++ util.cpp	(revision 198)
@@ -175,7 +175,6 @@
             va_start(arg_ptr, pszFormat);
             ret = vfprintf(fileout, pszFormat, arg_ptr);
             va_end(arg_ptr);
-            fflush(fileout);
         }
     }
 
@@ -406,11 +405,11 @@
         while (isspace(*psz))
             psz++;
         char c = phexdigit[(unsigned char)*psz++];
-        if (c == -1)
+        if (c == (char)-1)
             break;
         unsigned char n = (c << 4);
         c = phexdigit[(unsigned char)*psz++];
-        if (c == -1)
+        if (c == (char)-1)
             break;
         n |= c;
         vch.push_back(n);
