Skip to content

Commit a8d986d

Browse files
authored
Merge pull request #7 from aled-ua/patch-OSV-2024-379
Fix vuln OSV-2024-379
2 parents 6979c8a + 1126b83 commit a8d986d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/H5FSsection.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,7 +931,10 @@ H5FS__sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_
931931

932932
/* Determine correct bin which holds items of the section's size */
933933
bin = H5VM_log2_gen(sect->size);
934-
assert(bin < sinfo->nbins);
934+
/* Check if the bin index is within bounds */
935+
if (bin >= sinfo->nbins)
936+
HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, FAIL, "bin index out of bounds");
937+
935938
if (sinfo->bins[bin].bin_list == NULL) {
936939
if (NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL)))
937940
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for free space nodes");

0 commit comments

Comments
 (0)