Skip to content

Commit cc6432b

Browse files
committed
Fix partial packing of non data elements.
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>
1 parent 16b49dc commit cc6432b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

opal/datatype/opal_datatype_unpack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ opal_generic_simple_unpack_function( opal_convertor_t* pConvertor,
380380
}
381381
complete_loop:
382382
assert( pElem->elem.common.type < OPAL_DATATYPE_MAX_PREDEFINED );
383-
if( 0 != iov_len_local ) {
383+
if( (pElem->elem.common.flags & OPAL_DATATYPE_FLAG_DATA) && (0 != iov_len_local) ) {
384384
unsigned char* temp = conv_ptr;
385385
/* We have some partial data here. Let's copy it into the convertor
386386
* and keep it hot until the next round.
@@ -391,7 +391,7 @@ opal_generic_simple_unpack_function( opal_convertor_t* pConvertor,
391391
opal_unpack_partial_datatype( pConvertor, pElem,
392392
iov_ptr, 0, iov_len_local,
393393
&temp );
394-
394+
395395
pConvertor->partial_length = iov_len_local;
396396
iov_len_local = 0;
397397
}

0 commit comments

Comments
 (0)