From f92cab0bee90e4349550676f0f4bdf240f4d3669 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 1 Aug 2024 13:25:28 +0200 Subject: [PATCH] QtTest: Fix format error in _q_compareSequence() Commit 63295f43e70955a194602a7acf39013f124e14b7 changed the size: placeholders to %lld, but wrapped only one of the arguments in qlonglong. This causes 32-bit builds to read past the end of the expectedSize variable. Fix by wrapping the other, too. Pick-to: 6.7 6.5 6.2 5.15 Change-Id: I9c23ab589c8895e8f038fb508e18ac3006fa4f8f Reviewed-by: Fabian Kosmale Reviewed-by: Ivan Solovev (cherry picked from commit 57eff5b092dbd692594125edc70d3efd898660ea) Reviewed-by: Qt Cherry-pick Bot --- src/testlib/qtest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h index 9b8f12ec545..f3802d548b9 100644 --- a/src/testlib/qtest.h +++ b/src/testlib/qtest.h @@ -59,7 +59,7 @@ bool _q_compareSequence(ActualIterator actualIt, ActualIterator actualEnd, " Actual (%s) size: %lld\n" " Expected (%s) size: %lld", actual, qlonglong(actualSize), - expected, expectedSize); + expected, qlonglong(expectedSize)); } for (auto expectedIt = expectedBegin; isOk && expectedIt < expectedEnd; ++actualIt, ++expectedIt) {