1
1

opal_info_support.c: prevent a NULL pointer

If NULL is passed in, then assume the caller meant "".

This was CID 993714.
Этот коммит содержится в:
Jeff Squyres 2015-02-12 11:54:36 -08:00
родитель 29794af0e9
Коммит 4a85f759ec

Просмотреть файл

@ -10,7 +10,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-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. * Copyright (c) 2010-2013 Los Alamos National Security, LLC.
* All rights reserved. * All rights reserved.
* Copyright (c) 2011-2012 University of Houston. 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 #endif
/* Sanity check (allow NULL to mean "") */
if (NULL == value) {
value = "";
}
/* Strip leading and trailing whitespace from the string value */ /* Strip leading and trailing whitespace from the string value */
value_offset = strspn(value, " "); value_offset = strspn(value, " ");