diff options
author | Simon Warta <[email protected]> | 2018-05-07 23:29:05 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2018-05-07 23:29:05 +0200 |
commit | 90dc93660265baf2bf408b46b175590f451c6675 (patch) | |
tree | 9181212f5af5a2acb6f93378529cdc0134cc5a1a /src/lib/rng | |
parent | 3a676ad11a0bbeabcb4bf2a78946bfaed5086c9d (diff) |
Check return value of m_rtlgenrandom against proper type
Diffstat (limited to 'src/lib/rng')
-rw-r--r-- | src/lib/rng/system_rng/system_rng.cpp | 3 |
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"); } |