diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2017-09-21 11:19:32 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2017-09-28 11:25:06 +0000 |
commit | 621c5baf66722032927ecc4194771833b7aa57ae (patch) | |
tree | a934f1ef4cad54557e14a4217aa87ef91f7379cb /src/corelib/global/qrandom.cpp | |
parent | 9c13ec5fa392930e9a1880ad20c11ba47fdc54ba (diff) |
Fix element overwrite in QRandomGenerator's fallback function
Copy into the intended array elements, not into the start of the
array.
Change-Id: I05c4ece2450583c9358aa1eddfd702262e995146
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qrandom.cpp')
-rw-r--r-- | src/corelib/global/qrandom.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp index 2247394363..1063f772ab 100644 --- a/src/corelib/global/qrandom.cpp +++ b/src/corelib/global/qrandom.cpp @@ -312,7 +312,7 @@ static void fallback_fill(quint32 *ptr, qssize_t left) Q_DECL_NOTHROW // (other ELF-based systems don't seem to have AT_RANDOM) ulong auxvSeed = getauxval(AT_RANDOM); if (auxvSeed) { - memcpy(scratch, reinterpret_cast<void *>(auxvSeed), 16); + memcpy(end, reinterpret_cast<void *>(auxvSeed), 16); end += 4; // 7 to 10 } # endif |