From db675b984e9a1b753670cde5b46369767ad3693e Mon Sep 17 00:00:00 2001 From: lijincheng Date: Fri, 15 Sep 2023 11:37:36 +0800 Subject: [PATCH] Bugfix for parcel don't move readpos when validatereaddata is false Issue:https://gitee.com/openharmony/commonlibrary_c_utils/issues/I81MC5 Signed-off-by: lijincheng --- base/src/parcel.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/base/src/parcel.cpp b/base/src/parcel.cpp index 86f0215..70275fa 100644 --- a/base/src/parcel.cpp +++ b/base/src/parcel.cpp @@ -729,7 +729,6 @@ bool Parcel::Read(T &value) #ifdef PARCEL_OBJECT_CHECK size_t upperBound = readCursor_ + desireCapacity; if (!ValidateReadData(upperBound)) { - readCursor_ += desireCapacity; return false; } #endif @@ -785,7 +784,6 @@ const uint8_t *Parcel::BasicReadBuffer([[maybe_unused]]size_t length) uint8_t *buffer = data_ + readCursor_; size_t upperBound = readCursor_ + length; if (!ValidateReadData(upperBound)) { - readCursor_ += length; return nullptr; } readCursor_ += length; -- Gitee