qDecodeDataUrl(): fix precondition violation in call to QByteArrayView::at()
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Sun, 29 Jun 2025 19:50:45 +0000 (22:50 +0300)
committerDmitry Shachnev <mitya57@debian.org>
Sun, 29 Jun 2025 19:50:45 +0000 (22:50 +0300)
commita25a56d192cd5c2983d29eae41d5a5b8bf75da0c
tree27c6f42e866bc864120feba455f742e5231d69a7
parent3fdf01053b2cfb0a280d67758e0b06b7320515d3
qDecodeDataUrl(): fix precondition violation in call to QByteArrayView::at()

Origin: upstream, https://download.qt.io/official_releases/qt/5.15/CVE-2025-5455-qtbase-5.15.patch
Last-Update: 2025-06-29

It is a precondition violation to call QByteArrayView::at() with
size() as argument. The code used that, though, as an implicit
end-of-string check, assuming == ' ' and == '=' would both fail for
null bytes. Besides, QByteArrays (but most certainly QByteArrayViews)
need not be null-terminated, so this could read even past size().

To fix, use higher-level API (startsWith()), consuming parsed tokens
along the way.

Gbp-Pq: Name CVE-2025-5455.diff
src/corelib/io/qdataurl.cpp