diff --git a/base/src/parcel.cpp b/base/src/parcel.cpp index 86f021583331178531f7ce52a49965812962049e..70275fa828f24214edd99ba55d3328d531cb7709 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;