Merge pull request 'Fixed an small issue with buffer reading, not null termination guarantee' (#1) from detached into main

Reviewed-on: #1
This commit is contained in:
Luna 2025-07-07 06:49:37 +02:00
commit 36557dcf3d

View file

@ -82,7 +82,7 @@ template<>
inline void read_type<buffer>(buffer &val, char *data)
{
val.allocated = val.size + 1;
val.data = (char *)malloc(val.size * sizeof(char) + 1);
val.data = (char *)calloc(val.size, sizeof(char) + 1);
std::memcpy(val.data, data, val.size);
}