Skip to content

Commit 8b24a83

Browse files
committed
Fix vuln OSV-2024-370
1 parent 966454a commit 8b24a83

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/H5Ochunk.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ H5O__chunk_protect(H5F_t *f, H5O_t *oh, unsigned idx)
158158
HDassert(oh);
159159
HDassert(idx < oh->nchunks);
160160

161+
/* Additional bounds checking */
162+
if (idx >= oh->nchunks) {
163+
HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "chunk index out of bounds")
164+
}
165+
166+
161167
/* Check for protecting first chunk */
162168
if (0 == idx) {
163169
/* Create new "fake" chunk proxy for first chunk */

0 commit comments

Comments
 (0)