From 1a11eeb1d220d7f604766c8d66bad37b1579d783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E9=92=A6=E8=A1=97?= <15390014138@163.com> Date: Thu, 29 May 2025 22:21:00 +0800 Subject: [PATCH] =?UTF-8?q?fix=20[Bug]:=20ReadCString=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E7=BC=93=E5=86=B2=E5=8C=BA=E4=B8=AD=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=90=AB=E6=9C=89object=E7=9A=84ValidateReadData?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=8F=82=E6=95=B0=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冷钦街 <15390014138@163.com> --- base/src/parcel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/src/parcel.cpp b/base/src/parcel.cpp index d893964..d0a2d72 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); -- Gitee