Skip to content

Commit a7ed13d

Browse files
authored
Merge pull request #7907 from cniethammer/null_pointer_arithmetic_fix
Fix null pointer arithmetic resulting in potential undefined behavior
2 parents e547e2d + a3483e4 commit a7ed13d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

opal/class/opal_free_list.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,9 @@ int opal_free_list_grow_st (opal_free_list_t* flist, size_t num_elements, opal_f
272272
}
273273

274274
ptr += head_size;
275-
payload_ptr += elem_size;
275+
if (NULL != payload_ptr) {
276+
payload_ptr += elem_size;
277+
}
276278
}
277279

278280
if (OPAL_SUCCESS != rc && 0 == num_elements) {

0 commit comments

Comments
 (0)