summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornoloader <noloader@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2015-07-09 09:15:39 +0000
committernoloader <noloader@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2015-07-09 09:15:39 +0000
commit49437f71812c3f2bb2bd95005b574e045401ebba (patch)
tree62eeaf40bb8e614600dece1ff5066b5d11731ff0
parent2d4b3d58c671ec0c58a381b2ebe9e2f3aad55556 (diff)
downloadcryptopp-49437f71812c3f2bb2bd95005b574e045401ebba.tar.gz
Added test for 'v<0' in GetAsUIntValue
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@577 57ff6487-cd31-0410-9ec3-f628ee90f5f0
-rw-r--r--cryptlib.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/cryptlib.h b/cryptlib.h
index 906d498..89d52ba 100644
--- a/cryptlib.h
+++ b/cryptlib.h
@@ -303,7 +303,7 @@ public:
CRYPTOPP_DLL unsigned int GetAsUIntValueWithDefault(const char *name, unsigned int defaultValue) const
{
int v;
- if(!GetValue(name, v)) return defaultValue;
+ if(!GetValue(name, v) || v < 0) return defaultValue;
return static_cast<unsigned int>(v);
}