Skip to content

Commit 21e7f31

Browse files
committed
pmix2x: fix unpack sequence in PMIx_Get callback
first unpack the nspace (PMIX_STRING) before unpacking the various keys (PMIX_KVAL)
1 parent 477f6cb commit 21e7f31

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

opal/mca/pmix/pmix2x/pmix/src/client/pmix_client_get.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
22
/*
33
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
4-
* Copyright (c) 2014-2015 Research Organization for Information Science
4+
* Copyright (c) 2014-2016 Research Organization for Information Science
55
* and Technology (RIST). All rights reserved.
66
* Copyright (c) 2014 Artem Y. Polyakov <[email protected]>.
77
* All rights reserved.
@@ -298,6 +298,15 @@ static void _getnb_cbfunc(struct pmix_peer_t *pr, pmix_usock_hdr_t *hdr,
298298
if (PMIX_SUCCESS == (rc = pmix_bfrop.unpack(buf, &bptr, &cnt, PMIX_BUFFER))) {
299299
/* if the rank is WILDCARD, then this is an nspace blob */
300300
if (PMIX_RANK_WILDCARD == cur_rank) {
301+
char *nspace;
302+
/* unpack the nspace - we don't really need it, but have to
303+
* unpack it to maintain sequence */
304+
cnt = 1;
305+
if (PMIX_SUCCESS != (rc = pmix_bfrop.unpack(bptr, &nspace, &cnt, PMIX_STRING))) {
306+
PMIX_ERROR_LOG(rc);
307+
return;
308+
}
309+
free(nspace);
301310
pmix_client_process_nspace_blob(cb->nspace, bptr);
302311
} else {
303312
cnt = 1;

0 commit comments

Comments
 (0)