From 7709463b55636305e6b35dccaf6c403fa5c3d72d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 1 Apr 2021 23:03:47 -0700 Subject: 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 Reviewed-by: Lars Knoll --- src/corelib/tools/qhash.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/tools/qhash.cpp') 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) -- cgit v1.2.3