From 13f99cabb4342a08026c510655006cc92f4a6e13 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sat, 7 Sep 2024 14:46:22 -0700 Subject: [PATCH] NUL terminate mirror_vfd.c strings --- test/mirror_vfd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/mirror_vfd.c b/test/mirror_vfd.c index 124fc6a6b0c..fe6695b9a06 100644 --- a/test/mirror_vfd.c +++ b/test/mirror_vfd.c @@ -1236,6 +1236,7 @@ create_mirroring_split_fapl(const char *basename, struct mirrortest_filenames *n mirror_conf.handshake_port = opts->portno; if (strncpy(mirror_conf.remote_ip, opts->ip, H5FD_MIRROR_MAX_IP_LEN) == NULL) TEST_ERROR; + mirror_conf.remote_ip[H5FD_MIRROR_MAX_IP_LEN] = '\0'; if ((splitter_config->wo_fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) TEST_ERROR; if (H5Pset_fapl_mirror(splitter_config->wo_fapl_id, &mirror_conf) < 0) @@ -1248,8 +1249,10 @@ create_mirroring_split_fapl(const char *basename, struct mirrortest_filenames *n /* Set file paths for w/o and logfile */ if (strncpy(splitter_config->wo_path, (const char *)names->wo, H5FD_SPLITTER_PATH_MAX) == NULL) TEST_ERROR; + splitter_config->wo_path[H5FD_SPLITTER_PATH_MAX] = '\0'; if (strncpy(splitter_config->log_file_path, (const char *)names->log, H5FD_SPLITTER_PATH_MAX) == NULL) TEST_ERROR; + splitter_config->log_file_path[H5FD_SPLITTER_PATH_MAX] = '\0'; /* Create Splitter FAPL */ if ((ret_value = H5Pcreate(H5P_FILE_ACCESS)) < 0)