summaryrefslogtreecommitdiffstats
path: root/src/H5Pocpypl.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-09-14 16:21:31 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-09-14 16:21:31 (GMT)
commit050dd023870ac6858eaf55c20c7ffd46e97b1454 (patch)
treebd2f4bf92cedc0f45d4aa68d008ff03d05c56e07 /src/H5Pocpypl.c
parent102337449220dfc29be1cce29147704b9c760832 (diff)
downloadhdf5-050dd023870ac6858eaf55c20c7ffd46e97b1454.zip
hdf5-050dd023870ac6858eaf55c20c7ffd46e97b1454.tar.gz
hdf5-050dd023870ac6858eaf55c20c7ffd46e97b1454.tar.bz2
[svn-r27771] Description:
Merge in part of Neil's property list fixes: Fix a minor memory leak, add some sanity checks, clean up the code a little, and verify that encoding/ decoding default versions of the property lists works correctly. Tested on: MacOSX/64 10.10.5 (amazon) w/serial (Too minor to require h5committest)
Diffstat (limited to 'src/H5Pocpypl.c')
-rw-r--r--src/H5Pocpypl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c
index 08db49f..4a47dbc 100644
--- a/src/H5Pocpypl.c
+++ b/src/H5Pocpypl.c
@@ -296,6 +296,9 @@ H5P__ocpy_merge_comm_dt_list_dec(const void **_pp, void *_value)
HDassert(pp);
HDassert(*pp);
HDassert(dt_list);
+
+ /* Start off with NULL (default value) */
+ *dt_list = NULL;
/* Decode the string sequence */
len = HDstrlen(*(const char **)pp);
@@ -440,6 +443,9 @@ H5P__ocpy_merge_comm_dt_list_cmp(const void *_dt_list1, const void *_dt_list2,
/* Walk through the lists, comparing each path. For the lists to be the
* same, the paths must be in the same order. */
while(dt_list1 && dt_list2) {
+ HDassert(dt_list1->path);
+ HDassert(dt_list2->path);
+
/* Compare paths */
ret_value = HDstrcmp(dt_list1->path, dt_list2->path);
if(ret_value != 0) HGOTO_DONE(ret_value)
@@ -602,6 +608,8 @@ H5Padd_merge_committed_dtype_path(hid_t plist_id, const char *path)
/* Check parameters */
if(!path)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no path specified")
+ if(path[0] == '\0')
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "path is empty string")
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY)))