ChrisZhangJin opened a new issue, #426:
URL: https://github.com/apache/rocketmq-client-cpp/issues/426
I found there is a **mismatched free** in CProducer, scanned by Valgrind.
# valgrind report
here is the report sample,
> ==1570== Mismatched free() / delete / delete []
==1570== at 0x4C2B51D: operator delete(void*) (vg_replace_malloc.c:586)
==1570== by 0x1736BC86: DestroyProducer (in /usr/lib64/librocketmq.so)
... ....
==1570== Address 0xd1cfb10 is 0 bytes inside a block of size 256 alloc'd
==1570== at 0x4C2AC38: operator new[](unsigned long)
(vg_replace_malloc.c:433)
==1570== by 0x1736B7F9: CreateProducer (in /usr/lib64/librocketmq.so)
... ....
# the corresponding code
I checked the code, and found it was exactly mismatched for deleting a char
array.
here is the new

while here is the delete

# found version:
I just used 2.0.1 and 2.2.0, but both same with it.
-------------------
It is a vulnerability, not a literally bug actually.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]