Skip to content

Commit

Permalink
Fix partial packing of non data elements.
Browse files Browse the repository at this point in the history
There was a bug allowing for partial packing of non-data elements (such as loop
and end_loop markers) during the exit condition of a pack/unpack call. This has
basically no meaning. Prevent this bug from happening by making sure the element
point to a data before trying to partially pack it.

Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
  • Loading branch information
bosilca committed Oct 25, 2020
1 parent 16b49dc commit cc6432b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opal/datatype/opal_datatype_unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ opal_generic_simple_unpack_function( opal_convertor_t* pConvertor,
}
complete_loop:
assert( pElem->elem.common.type < OPAL_DATATYPE_MAX_PREDEFINED );
if( 0 != iov_len_local ) {
if( (pElem->elem.common.flags & OPAL_DATATYPE_FLAG_DATA) && (0 != iov_len_local) ) {
unsigned char* temp = conv_ptr;
/* We have some partial data here. Let's copy it into the convertor
* and keep it hot until the next round.
Expand All @@ -391,7 +391,7 @@ opal_generic_simple_unpack_function( opal_convertor_t* pConvertor,
opal_unpack_partial_datatype( pConvertor, pElem,
iov_ptr, 0, iov_len_local,
&temp );

pConvertor->partial_length = iov_len_local;
iov_len_local = 0;
}
Expand Down

0 comments on commit cc6432b

Please sign in to comment.