Skip to content

Commit cc747f4

Browse files
committed
io/ompio: fix for CID 1645292
protect a variable against potentially accessing the element -1 in an array using an assert statement. Signed-off-by: Edgar Gabriel <[email protected]>
1 parent c888f7b commit cc747f4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ompi/mca/io/ompio/io_ompio_file_open.c

+1
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ static void mca_io_ompio_file_get_eof_offset (ompio_file_t *fh,
427427
}
428428

429429
offset = prev_offset;
430+
assert(index_in_file_view > 0);
430431
blocklen = fh->f_fview.f_decoded_iov[index_in_file_view-1].iov_len;
431432
while (offset <= in_offset && k <= blocklen) {
432433
prev_offset = offset;

0 commit comments

Comments
 (0)