summaryrefslogtreecommitdiff
path: root/cryptlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'cryptlib.h')
-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);
}