From 98b6d653859ae707356369e9bffcf70701899984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20Papaur=C3=A9?= Date: Wed, 6 May 2015 17:50:08 +0200 Subject: [PATCH 1/2] avoid use of non initialized variable --- opal/mca/base/mca_base_pvar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opal/mca/base/mca_base_pvar.c b/opal/mca/base/mca_base_pvar.c index c7627ab453..33175a562a 100644 --- a/opal/mca/base/mca_base_pvar.c +++ b/opal/mca/base/mca_base_pvar.c @@ -3,6 +3,7 @@ * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Bull SAS. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -296,7 +297,7 @@ int mca_base_pvar_register (const char *project, const char *framework, const ch } opal_hash_table_set_value_ptr (&mca_base_pvar_index_hash, pvar->name, strlen (pvar->name), - (void *)(uintptr_t) pvar->pvar_index); + (void *)(uintptr_t) pvar_count); pvar_count++; ret = OPAL_SUCCESS; From c03b3b135c1925be418eebf7e6ceab4972d24e50 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Sat, 25 Jul 2015 15:32:00 -0400 Subject: [PATCH 2/2] Don't allow multiple pvar with the same pvar_index. Fix Cisco copyright. --- opal/mca/base/mca_base_pvar.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/opal/mca/base/mca_base_pvar.c b/opal/mca/base/mca_base_pvar.c index 33175a562a..b7cf0e2c76 100644 --- a/opal/mca/base/mca_base_pvar.c +++ b/opal/mca/base/mca_base_pvar.c @@ -2,8 +2,11 @@ /* * Copyright (c) 2013-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Bull SAS. All rights reserved. + * Copyright (c) 2015 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -296,8 +299,9 @@ int mca_base_pvar_register (const char *project, const char *framework, const ch break; } + pvar->pvar_index = pvar_count; opal_hash_table_set_value_ptr (&mca_base_pvar_index_hash, pvar->name, strlen (pvar->name), - (void *)(uintptr_t) pvar_count); + (void *)(uintptr_t) pvar->pvar_index); pvar_count++; ret = OPAL_SUCCESS; @@ -330,7 +334,6 @@ int mca_base_pvar_register (const char *project, const char *framework, const ch } pvar->ctx = ctx; - pvar->pvar_index = pvar_count; return pvar->pvar_index; }