From: Dmitry Shachnev Date: Mon, 24 Mar 2025 12:42:48 +0000 (+0300) Subject: fix containsTLDEntry crash when there are three or more chunks X-Git-Tag: archive/raspbian/5.15.15+dfsg-5+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=13c3f279d4536f8fc42c40211e3ea48a12a7115c;p=qtbase-opensource-src.git 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 --- 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