From 4a85f759ec0a8b2c44890237cf8b94febb582375 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Thu, 12 Feb 2015 11:54:36 -0800 Subject: [PATCH] opal_info_support.c: prevent a NULL pointer If NULL is passed in, then assume the caller meant "". This was CID 993714. --- opal/runtime/opal_info_support.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opal/runtime/opal_info_support.c b/opal/runtime/opal_info_support.c index 547e1fbd2a..d2085bfec9 100644 --- a/opal/runtime/opal_info_support.c +++ b/opal/runtime/opal_info_support.c @@ -10,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2006-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2010-2013 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2011-2012 University of Houston. All rights reserved. @@ -791,6 +791,11 @@ void opal_info_out(const char *pretty_message, const char *plain_message, const } #endif + /* Sanity check (allow NULL to mean "") */ + if (NULL == value) { + value = ""; + } + /* Strip leading and trailing whitespace from the string value */ value_offset = strspn(value, " ");