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:
commit
36557dcf3d
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue