summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qhash.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2021-04-01 23:03:47 -0700
committerThiago Macieira <thiago.macieira@intel.com>2021-04-16 17:51:30 -0700
commit7709463b55636305e6b35dccaf6c403fa5c3d72d (patch)
treed2835408fde9bfe091cf79daaadcee683107f8e5 /src/corelib/tools/qhash.cpp
parent9252b9bb92ceeb05fb1700dfcf283ab10189be50 (diff)
QHash: allow an empty QT_HASH_SEED env variable to reset
It's much easier to un-do a QT_HASH_SEED=0 by simply setting it to empty in a command-line, as in: QT_HASH_SEED= ./appname [ChangeLog][Important Behavior Changes] Previously, if the QT_HASH_SEED environment variable was set but empty, Qt would interpret that as if it had been set to 0, thus disabling the hash salting functionality. Since this makes setting and unsetting this variable difficult in scripts, it has been changed: if the variable is set but empty, it is interpreted now as if it had not been set and the hash salting functionality is enabled. Change-Id: Id2983978ad544ff79911fffd1671f5473978a6bc Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/tools/qhash.cpp')
-rw-r--r--src/corelib/tools/qhash.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 23eb07406c..f2e50b6ae0 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -721,7 +721,7 @@ static uint qt_create_qhash_seed()
#ifndef QT_BOOTSTRAPPED
QByteArray envSeed = qgetenv("QT_HASH_SEED");
- if (!envSeed.isNull()) {
+ if (!envSeed.isEmpty()) {
uint seed = envSeed.toUInt();
if (seed) {
// can't use qWarning here (reentrancy)