1
1

opal_environ.c: ensure "value" is a valid string for the setenv() case

This was CID 1269764.
Этот коммит содержится в:
Jeff Squyres 2015-02-12 10:54:08 -08:00
родитель 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);