opal_environ.c: ensure "value" is a valid string for the setenv() case
This was CID 1269764.
Этот коммит содержится в:
родитель
f1dc29b145
Коммит
e188c75edc
@ -9,7 +9,7 @@
|
|||||||
* University of Stuttgart. All rights reserved.
|
* University of Stuttgart. All rights reserved.
|
||||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
* Copyright (c) 2007-2013 Los Alamos National Security, LLC. All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
* Copyright (c) 2014 Intel, Inc. All rights reserved.
|
||||||
@ -101,6 +101,7 @@ int opal_setenv(const char *name, const char *value, bool overwrite,
|
|||||||
/* Make the new value */
|
/* Make the new value */
|
||||||
|
|
||||||
if (NULL == value) {
|
if (NULL == value) {
|
||||||
|
value = "";
|
||||||
asprintf(&newvalue, "%s=", name);
|
asprintf(&newvalue, "%s=", name);
|
||||||
} else {
|
} else {
|
||||||
asprintf(&newvalue, "%s=%s", name, value);
|
asprintf(&newvalue, "%s=%s", name, value);
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user