summaryrefslogtreecommitdiffstats
path: root/c++/src
diff options
context:
space:
mode:
authorMark Kittisopikul <mkitti@users.noreply.github.com>2023-07-16 04:31:57 (GMT)
committerGitHub <noreply@github.com>2023-07-16 04:31:57 (GMT)
commit426a7f82f6ce4d75ec8bfd30d1fa198c49efaa97 (patch)
treeb6c081097820ecf75c62fca196ab6e85f8e81cb8 /c++/src
parent305ac8886566968ae58ba771e0ae2ba6434ac9f0 (diff)
downloadhdf5-426a7f82f6ce4d75ec8bfd30d1fa198c49efaa97.zip
hdf5-426a7f82f6ce4d75ec8bfd30d1fa198c49efaa97.tar.gz
hdf5-426a7f82f6ce4d75ec8bfd30d1fa198c49efaa97.tar.bz2
Avoid truncating at null byte when copying to std::string (#3083)
--------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'c++/src')
-rw-r--r--c++/src/H5DataSet.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp
index 7d19a6d..40b40f2 100644
--- a/c++/src/H5DataSet.cpp
+++ b/c++/src/H5DataSet.cpp
@@ -729,7 +729,7 @@ DataSet::p_read_fixed_len(const hid_t mem_type_id, const hid_t mem_space_id, con
}
// Get string from the C char* and release resource allocated locally
- strg = strg_C;
+ strg = H5std_string(strg_C, data_size);
delete[] strg_C;
}
}