summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-053-6/+7
|\ | | | | | | Change-Id: Ib58433da04bffb5dfab5486b80f17f39cc4145fa
| * QJsonDocument: Validate also zero-length objectsJüri Valdmann2018-05-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The added test case is the binary JSON equivalent of {"a":{"š":null}} with two modifications. First, the length of the string "š" has been corrupted to 0xFFFFFF00. Second and more import, the Base::size field of the inner object has been reset to 0. On its own the first modification would normally trigger a validation error. However, due to the second modification the Value::usedStorage for the inner object evaluates to 0, completely disabling all further validation of the object's contents. Attempting to convert this binary JSON into standard JSON will lead to the JSON writer trying to construct a QString of length 0xFFFFFF00. Fixed by validating also objects with usedStorage == 0. Task-number: QTBUG-61969 Change-Id: I5e59383674dec9be89361759572c0d91d4e16e01 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QJsonDocument: Reject objects containing themselves in binary JSONJüri Valdmann2018-05-041-3/+3
| | | | | | | | | | | | | | | | | | | | The added test case is a binary JSON file describing an array which contains itself. This file passes validation even though attempting to convert it to plain JSON leads to an infinite loop. Fixed by rejecting it in validation. Task-number: QTBUG-61969 Change-Id: Ib4472e9777d09840c30c384b24294e4744b02045 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * QJsonDocument::fromRawData: Fix out-of-bounds accessJüri Valdmann2018-05-042-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This method takes a pointer+size pair, but begins reading through the pointer without first checking the size parameter. Fixed by checking the size parameter. A new test case is added with an empty binary json file. Although the test does not fail under normal conditions, the problem can be detected using valgrind or AddressSanitizer. Task-number: QTBUG-61969 Change-Id: Ie91cc9a56dbc3c676472c614d4e633d7721b8481 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-021-0/+20
|\| | | | | | | Change-Id: I967eca8f34584fca3a1e5696978e70f620582a2a
| * JSON: remove braces from UUID text representationsThiago Macieira2018-03-021-0/+9
| | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QJsonValue] fromVariant() conversion now converts from QUrl and QUuid using special encoding forms to ensure best JSON compatibility. Change-Id: I56b444f9d6274221a3b7fffd150cdc5ca1f87ff1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * QJsonValue: use the fully-encoded form of a URL in fromVariant()Thiago Macieira2018-03-021-0/+11
| | | | | | | | | | | | | | For compatibility with other parsers that may expect it to be so. Change-Id: I56b444f9d6274221a3b7fffd150cd66390f98fd5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-02-242-2/+4
|\| | | | | | | Change-Id: Icddf8720dae2cf594e16bcddab4d1cafc9d094c0
| * Reapply 1514b4e85336245ef130deca5839267dba7b2e32 on 5.11Liang Qi2018-02-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | This change amends 305dd1b61f657474d751cc3b24f58249ec21b61b, which lost 1514b4e8 and brought src/corelib/json/qjsonarray.cpp back, which got removed in c9c9adeef943d8265b2dae57ff48992c23b6725a. In a6b697ca13945a174cff9f3e9b1af1cf61c0bea5, it was moved to src/corelib/serialization/qjsonarray.cpp in 5.11. Change-Id: Ic6134a78d75a9c245934cf70a67a54c80a3e7c85 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Reapply 403343039d07812c0beee9260b291f86e14d8ac4 on 5.11Liang Qi2018-02-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | This change amends 305dd1b61f657474d751cc3b24f58249ec21b61b, which lost 40334303 and brought src/corelib/xml/qxmlstream_p.h back. In a6b697ca13945a174cff9f3e9b1af1cf61c0bea5, it was moved to src/corelib/serialization/qxmlstream_p.h in 5.11. Change-Id: Ia1e9841b866ff49f7274b1b13fd224c0a20a017e Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Bump versionOswald Buddenhagen2018-02-202-2/+4
|/ | | | Change-Id: I930e3fdd98f6a32a130ddcf671cf68f61d0c225d
* JSON: use the new isLatin1 functionThiago Macieira2018-01-271-8/+1
| | | | | | | It's vectorized, so it should be faster than this version. Change-Id: I56b444f9d6274221a3b7fffd150c1519eb999cdc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: explain how QXmlStream{Reader,Writer} deal with encoding in QStringThiago Macieira2018-01-261-0/+20
| | | | | | | | | | | QXmlStreamWriter does not: it just writes the QString inputs to the output. QXmlStreamReader does: it first converts the QString to UTF-8 and stores locally. Then it tries to decode using the XML encoding header. Change-Id: I39332e0a867442d58082fffd1503d7652cb9fbff Reviewed-by: Martin Smith <martin.smith@qt.io>
* Create corelib/serialization and move existing file formats into itThiago Macieira2018-01-2629-0/+22330
This is in preparation to adding CBOR support. We don't need yet another dir for CBOR and placing it in src/corelib/json is just wrong. Change-Id: I9741f017961b410c910dfffd14ffb9d870340fa6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>