From 5283a6c87beac5a43f612786fefd6e43f2c70bf6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 19 May 2014 16:53:34 -0700 Subject: Disable hash seeding for bootstrapped tools Any bootstrapped tool is a development tool, by definition. So the effects of seeding the hash with a random number can cause the same source input to produce different binary results, which can throw some caching tools into disarray (like the Open Build System). There should be minimal fall out from the reduced protection against DoS. Since those are only development tools, "specially crafted" input implies the developer is DoS'ing him/herself. Note: the change to qhash.cpp applies to moc and rcc, which are always bootstrapped. Change-Id: I061ab52036e40627c0703f1bf881455cbf848f43 Reviewed-by: Oswald Buddenhagen Reviewed-by: hjk --- src/tools/qdoc/main.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tools/qdoc') diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp index 398d188464..3d2ee409b0 100644 --- a/src/tools/qdoc/main.cpp +++ b/src/tools/qdoc/main.cpp @@ -542,6 +542,7 @@ static void processQdocconfFile(const QString &fileName) Generator::debugSegfault("qdoc finished!"); } +extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed; QT_END_NAMESPACE int main(int argc, char **argv) @@ -549,6 +550,7 @@ int main(int argc, char **argv) QT_USE_NAMESPACE #ifndef QT_BOOTSTRAPPED + qt_qhash_seed.testAndSetRelaxed(-1, 0); // set the hash seed to 0 if it wasn't set yet QCoreApplication app(argc, argv); #endif -- cgit v1.2.3