summaryrefslogtreecommitdiffstats
path: root/src/gui/doc/snippets/textdocument-resources/main.cpp
diff options
context:
space:
mode:
authorMarc Mutz <[email protected]>2025-08-22 15:02:35 +0200
committerMarc Mutz <[email protected]>2025-08-25 18:31:13 +0000
commitcfb1596ef9e97517f3cf54e2682698d181c5b3e6 (patch)
treefedb8287f00ef34eb3ac327bcedc91817f8a1824 /src/gui/doc/snippets/textdocument-resources/main.cpp
parent78a86f29f3c620e0fdee8912a78089315ee3cd01 (diff)
QJsonDocument/Value: fix integer truncation in fromJson(QByteArray)HEADdev
The old code passed the QByteArray's size() to the QJsonPrivate::Parser ctor's length argument, which, however, was still 'int', truncating. Making matters worse, the Parser ctor only used the length to calculate an end iterator. Fix by passing by QUtf8StringView. This also indicates that the Parser expects UTF-8 input (and not Latin1, e.g.). As a drive-by, make the Parser ctor explicit. [ChangeLog][QtCore][QJsonDocument/QJsonValue] Fixed a bug on 64-bit platforms where fromJson(QByteArray) could report one of the Unterminated errors for valid input whose size merely exceeded INT_MAX (2GiB). Amends the port of QByteArray to qsizetype (Qt 6.0, didn't check exact commit). Pick-to: 6.10 6.9 6.8 6.5 Task-number: QTBUG-103541 Change-Id: I3e4f7c098a98e8840e15ff6cc63bee2121118129 Reviewed-by: Thiago Macieira <[email protected]>
Diffstat (limited to 'src/gui/doc/snippets/textdocument-resources/main.cpp')
0 files changed, 0 insertions, 0 deletions