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 oss-fuzz vulns #5209

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion src/H5FSsection.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,10 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_

/* Determine correct bin which holds items of the section's size */
bin = H5VM_log2_gen(sect->size);
assert(bin < sinfo->nbins);
/* Check if the bin index is within bounds */
if (bin >= sinfo->nbins)
HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, FAIL, "bin index out of bounds");

if (sinfo->bins[bin].bin_list == NULL) {
if (NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL)))
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for free space nodes");
Expand Down
5 changes: 5 additions & 0 deletions src/H5SM.c
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,11 @@ H5SM_delete(H5F_t *f, H5O_t *open_oh, H5O_shared_t *sh_mesg)
assert(H5_addr_defined(H5F_SOHM_ADDR(f)));
assert(sh_mesg);

/* Validate the SOHM address */
if (!H5_addr_defined(H5F_SOHM_ADDR(f))) {
HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "SOHM address is invalid or uninitialized");
}

/* Get message type */
type_id = sh_mesg->msg_type_id;

Expand Down
Loading