summaryrefslogtreecommitdiffstats
path: root/test/cache_logging.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2021-04-29 14:33:43 (GMT)
committerGitHub <noreply@github.com>2021-04-29 14:33:43 (GMT)
commit16f9b070ce084313de37cc73968f70f2cba0b75a (patch)
tree187f19d17a5daff0b61d94fa0669b9277d2d0bd5 /test/cache_logging.c
parent138bc52facad0e6be4cfd13a860bb628c1dfd626 (diff)
downloadhdf5-16f9b070ce084313de37cc73968f70f2cba0b75a.zip
hdf5-16f9b070ce084313de37cc73968f70f2cba0b75a.tar.gz
hdf5-16f9b070ce084313de37cc73968f70f2cba0b75a.tar.bz2
Fixes a segfault when H5Pset_mdc_log_options is called multiple times on a fapl (#601)
* Committing clang-format changes * Fixes a segfault when H5Pset_mdc_log_options() is called multiple times An internal string is incorrectly freed when the API call is invoked multiple times on a property list, which will usually cause a segfault to occur. On the first call the log location is NULL so the problem doesn't occur. Fixes HDFFV-11239 * Fixes typos Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'test/cache_logging.c')
-rw-r--r--test/cache_logging.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/cache_logging.c b/test/cache_logging.c
index 93d4505..12f3d96 100644
--- a/test/cache_logging.c
+++ b/test/cache_logging.c
@@ -59,6 +59,12 @@ test_logging_api(void)
if (H5Pset_mdc_log_options(fapl, is_enabled, LOG_LOCATION, start_on_access) < 0)
TEST_ERROR;
+ /* Ensure that setting the property twice doesn't cause problems
+ * (addresses a previous bug).
+ */
+ if (H5Pset_mdc_log_options(fapl, is_enabled, LOG_LOCATION, start_on_access) < 0)
+ TEST_ERROR;
+
/* Check to make sure that the property list getter returns the correct
* location string buffer size;
*/