Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1779,6 +1779,11 @@ static int wp11_storage_read_alloc_array(void* storage,
/* Read length of array. */
ret = wp11_storage_read_int(storage, len);
if (ret == 0) {
if (*len == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to see about solving the malloc of 0 instead. I am going to open a new PR with a few other fixes.

XFREE(*buffer, NULL, DYNAMIC_TYPE_TMP_BUFFER);
*buffer = NULL;
return 0;
}
/* Allocate buffer to hold data. */
*buffer = (unsigned char*)XMALLOC(*len, NULL, DYNAMIC_TYPE_TMP_BUFFER);
if (*buffer == NULL)
Expand Down
Loading