From 1485fbbc1ca3ce0be8d2314c24e04a5b68cdd28e Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Sat, 8 Feb 2025 19:24:33 +0300 Subject: [PATCH] fix containsTLDEntry crash when there are three or more chunks Forwarded: no Bug-Debian: https://bugs.debian.org/1095423 Last-Update: 2025-02-08 tldChunks[N] contains total size of chunks from 0 to N, not just the Nth one. Gbp-Pq: Name containsTLDEntry.diff --- src/corelib/io/qtldurl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qtldurl.cpp b/src/corelib/io/qtldurl.cpp index 7a4ab36c5..085490408 100644 --- a/src/corelib/io/qtldurl.cpp +++ b/src/corelib/io/qtldurl.cpp @@ -86,8 +86,8 @@ static bool containsTLDEntry(QStringView entry, TLDMatchType match) // Find which chunk contains the tldGroupOffset while (tldGroupOffset >= tldChunks[chunk]) { - chunkIndex -= tldChunks[chunk]; - offset += tldChunks[chunk]; + chunkIndex = tldIndices[index] - tldChunks[chunk]; + offset = tldChunks[chunk]; chunk++; // We can not go above the number of chunks we have, since all our -- 2.30.2