Client programs may crash by calling listAllAPIDataCSV of EnergyPlus API. [closed]
I found a bug in a source file of EnergyPlus/api/datatransfer.cc. (Version 22.2.0)
At the end of the definition of listAllAPIDataCSV function, there are following codes.
char *p = new char[std::strlen(output.c_str())];
std::strcpy(p, output.c_str());
return p;
I think that strcpy function copies null character after the string, so length of new char[] has to be strlen() + 1 byte or more.
I think you are right. That said, this type of things should be best posted as an issue directly at https://github.com/NREL/EnergyPlus/is....
Thank you for posting this issue and quick fix.