aboutsummaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2011-10-01 02:47:47 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2011-10-01 17:29:46 +0200
commit2f7f2a5fca52f064a2f5663ab46c7c16e1b117f8 (patch)
treed6711b3f81f68e00cc5caf56840788215a1796ec /src/util.cpp
parentf4769e44a326f61bdf47fa39346e1293b97e31c4 (diff)
remove possibility of 63 bit overflow in ParseMoney
- also, add unit tests for various functions in util.cpp/util.h
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.cpp b/src/util.cpp
index fb648a9721..02e2d21491 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -387,7 +387,7 @@ bool ParseMoney(const char* pszIn, int64& nRet)
for (; *p; p++)
if (!isspace(*p))
return false;
- if (strWhole.size() > 14)
+ if (strWhole.size() > 10) // guard against 63 bit overflow
return false;
if (nUnits < 0 || nUnits > COIN)
return false;