Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uninitialized memory issues in packet table #4271

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion hl/src/H5TB.c
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi
goto out;

/* alloc fill value attribute buffer */
if (NULL == (tmp_fill_buf = (unsigned char *)malloc(total_size)))
if (NULL == (tmp_fill_buf = (unsigned char *)calloc(1, total_size)))
goto out;

/* get the fill value attributes */
Expand Down
2 changes: 2 additions & 0 deletions hl/test/test_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ test_table(hid_t fid, int do_write)
field_type[3] = H5T_NATIVE_DOUBLE;
field_type[4] = H5T_NATIVE_INT;

memset(wbufd, 0, NRECORDS * sizeof(particle_t));

/*-------------------------------------------------------------------------
*
* Functions tested:
Expand Down
Loading