diff --git a/base/src/parcel.cpp b/base/src/parcel.cpp index d893964bb2d9111d9ddc1365ba1149872a04ad9f..d0a2d7253222c47f4b77491320638ccbadd67e05 100644 --- a/base/src/parcel.cpp +++ b/base/src/parcel.cpp @@ -1108,7 +1108,7 @@ const char *Parcel::ReadCString() const char* eos = reinterpret_cast(memchr(cstr, 0, avail)); if (eos != nullptr) { const size_t dataLength = eos - cstr; - if (!ValidateReadData(dataLength + 1)) { + if (!ValidateReadData(readCursor_ + dataLength + 1)) { return nullptr; } readCursor_ += (dataLength + 1);