summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2018-10-27 19:43:09 -0700
committerThiago Macieira <thiago.macieira@intel.com>2018-11-08 15:19:45 +0000
commite7998dc187cf8f1218711ac963c441afbea1577c (patch)
treef367243b5781f09d688d71b9d15c6fcf5a48ecaa /src/corelib
parentc0b1230108090cf914ccc5329b1213063ed21bdd (diff)
QCborStreamReader: make sure setDevice() clears the last error
The unit tests weren't running into this problem because the every setDevice() was preceded by the object being initialized with the exact same data, so there was never a previous error state. I've only changed a couple of tests, left the other setDevice() unchanged so we test both behaviors. Fixes: QTBUG-71426 Change-Id: I1bd327aeaf73421a8ec5fffd1561a590e3933376 Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/serialization/qcborstream.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/serialization/qcborstream.cpp b/src/corelib/serialization/qcborstream.cpp
index 22286188b8..fc5610e341 100644
--- a/src/corelib/serialization/qcborstream.cpp
+++ b/src/corelib/serialization/qcborstream.cpp
@@ -1779,6 +1779,8 @@ public:
preread();
if (CborError err = cbor_parser_init_reader(nullptr, &parser, &currentElement, this))
handleError(err);
+ else
+ lastError = { QCborError::NoError };
}
char *bufferPtr()