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); }