aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Warta <[email protected]>2018-05-07 23:29:05 +0200
committerSimon Warta <[email protected]>2018-05-07 23:29:05 +0200
commit90dc93660265baf2bf408b46b175590f451c6675 (patch)
tree9181212f5af5a2acb6f93378529cdc0134cc5a1a
parent3a676ad11a0bbeabcb4bf2a78946bfaed5086c9d (diff)
Check return value of m_rtlgenrandom against proper type
-rw-r--r--src/lib/rng/system_rng/system_rng.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/rng/system_rng/system_rng.cpp b/src/lib/rng/system_rng/system_rng.cpp
index 65d4dcb02..39ccf2f6b 100644
--- a/src/lib/rng/system_rng/system_rng.cpp
+++ b/src/lib/rng/system_rng/system_rng.cpp
@@ -41,7 +41,8 @@ class System_RNG_Impl final : public RandomNumberGenerator
void randomize(uint8_t buf[], size_t len) override
{
- if(m_rtlgenrandom(buf, len) == false)
+ bool success = m_rtlgenrandom(buf, len) == TRUE;
+ if(!success)
throw Exception("RtlGenRandom failed");
}