From 981b4c9d04a5476f0dd957c24be32bea433a0566 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 9 Jul 2015 05:24:10 -0400 Subject: [PATCH] Added test for 'v<0' in GetAsUIntValue --- cryptlib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptlib.h b/cryptlib.h index 906d4982..89d52bab 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(v); }