Skip to content

Commit 3ff0186

Browse files
author
nshpak
committed
opal/params: Fix opal_var_dump_color array buffer overflow
Allocate missing element for opal_var_dump_color to ensure it is NULL-terminated. Signed-off-by: nshpak <[email protected]>
1 parent a8fbb4d commit 3ff0186

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

opal/runtime/opal_params_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* Copyright (c) 2014 Hochschule Esslingen. All rights reserved.
2020
* Copyright (c) 2015 Research Organization for Information Science
2121
* and Technology (RIST). All rights reserved.
22-
* Copyright (c) 2015 Mellanox Technologies, Inc.
22+
* Copyright (c) 2015-2023 Mellanox Technologies, Inc.
2323
* All rights reserved.
2424
* Copyright (c) 2017 IBM Corporation. All rights reserved.
2525
* Copyright (c) 2018-2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
@@ -89,7 +89,7 @@ static bool opal_register_util_done = false;
8989

9090
static char *opal_var_dump_color_string = NULL;
9191

92-
static char *opal_var_dump_color_keys[OPAL_VAR_DUMP_COLOR_KEY_COUNT] = {
92+
static char *opal_var_dump_color_keys[OPAL_VAR_DUMP_COLOR_KEY_COUNT + 1] = {
9393
[OPAL_VAR_DUMP_COLOR_VAR_NAME] = "name",
9494
[OPAL_VAR_DUMP_COLOR_VAR_VALUE] = "value",
9595
[OPAL_VAR_DUMP_COLOR_VALID_VALUES] = "valid_values"

0 commit comments

Comments
 (0)