This is an automated email from the ASF dual-hosted git repository.
dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git
The following commit(s) were added to refs/heads/master by this push:
new 11985f3 heap-buffer-overflow risk (#241)
11985f3 is described below
commit 11985f3b0fe59c265ce19d3faea7a85413f99898
Author: WoodsCumming <[email protected]>
AuthorDate: Mon Feb 17 07:48:08 2020 +0800
heap-buffer-overflow risk (#241)
---
src/protocol/CommandHeader.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/protocol/CommandHeader.cpp b/src/protocol/CommandHeader.cpp
index 30dcf59..bc02028 100644
--- a/src/protocol/CommandHeader.cpp
+++ b/src/protocol/CommandHeader.cpp
@@ -511,7 +511,7 @@ void
ConsumerSendMsgBackRequestHeader::SetDeclaredFieldOfCommandHeader(map<strin
void GetConsumerListByGroupResponseBody::Decode(const MemoryBlock* mem,
vector<string>& cids) {
cids.clear();
//<! decode;
- const char* const pData = static_cast<const char*>(mem->getData());
+ const std::string pData(mem->getData(), mem->getSize());
Json::Reader reader;
Json::Value root;