Fix uninitialized memory issues in packet table (#4271)

This commit is contained in:
Dana Robinson 2024-03-27 20:26:34 -07:00 committed by GitHub
parent 82442ed983
commit 8787e7f325
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -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 */

View File

@ -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: