Skip to content

Commit 948de6e

Browse files
authored
Merge pull request #11147 from drwootton/hook_memory_overlay
Fix possible invalid memory access in add_string_to_conversion_struct: Coverity CID 1515758
2 parents d9e5878 + f3b890d commit 948de6e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ompi/mca/hook/comm_method/hook_comm_method_fns.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ add_string_to_conversion_struct(comm_method_string_conversion_t *data, char *str
202202
if (i == 0) { // didn't find string in list, so add it
203203
if (data->n < MAX_COMM_METHODS) {
204204
strncpy(data->str[data->n], string, COMM_METHOD_STRING_SIZE);
205+
data->str[data->n][COMM_METHOD_STRING_SIZE - 1] = '\0';
205206
++(data->n);
206207
}
207208
}

0 commit comments

Comments
 (0)