From 6ce5d0908d40d03457c4ae9548664a6f79a50355 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 17 Aug 2022 18:08:05 +0200 Subject: [PATCH] QContiguousCache: fix streaming into QDebug when indices are > INT_MAX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As usual, int/qsizetype mismatch. Task-number: QTBUG-103525 Change-Id: Ic5d9fb4fd42e4534ec0358ca7c4d79650c6ac919 Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit db4480062796482da766a58f4812faf63d8acab0) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/io/qdebug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 40f65fd29b3..8147f0e9ffe 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -292,7 +292,7 @@ inline QDebugIfHasDebugStream operator<<(QDebug debug, const QContiguousCache { const QDebugStateSaver saver(debug); debug.nospace() << "QContiguousCache("; - for (int i = cache.firstIndex(); i <= cache.lastIndex(); ++i) { + for (qsizetype i = cache.firstIndex(); i <= cache.lastIndex(); ++i) { debug << cache[i]; if (i != cache.lastIndex()) debug << ", ";