There are many uses of char* for both binary and text buffers, in C++ it is very convenient to use std::vector<char> for any binary buffers, and for any text buffers std::string, you can specify the size of the buffer and initialize it with 0's with something like so:
std::vector<char> buffer(kDesiredSize, {});
try to apply these changes to your project, and see the improvements.
You also have the ability to resize those buffers and modify them at will quite easily.