diff options
author | Jordan Henderson <jhenderson@hdfgroup.org> | 2019-08-21 03:02:12 (GMT) |
---|---|---|
committer | Jordan Henderson <jhenderson@hdfgroup.org> | 2019-08-21 16:56:50 (GMT) |
commit | 0de0965c61823186ac61c0d6876d4d77578e5bcc (patch) | |
tree | 81b14f153939f0fee7566406991f44e40685b1e1 | |
parent | f0272e4945f047f17043b484db594df131222f1e (diff) | |
download | hdf5-0de0965c61823186ac61c0d6876d4d77578e5bcc.zip hdf5-0de0965c61823186ac61c0d6876d4d77578e5bcc.tar.gz hdf5-0de0965c61823186ac61c0d6876d4d77578e5bcc.tar.bz2 |
Fix issue in H5Lcreate_hard and H5Olink where entire H5VL_loc_params_t structure was passed via varargs
-rw-r--r-- | src/H5L.c | 2 | ||||
-rw-r--r-- | src/H5O.c | 2 | ||||
-rw-r--r-- | src/H5VLnative_link.c | 8 |
3 files changed, 6 insertions, 6 deletions
@@ -578,7 +578,7 @@ H5Lcreate_hard(hid_t cur_loc_id, const char *cur_name, tmp_vol_obj.connector = (vol_obj1 != NULL ? vol_obj1->connector : vol_obj2->connector); /* Create the link */ - if(H5VL_link_create(H5VL_LINK_CREATE_HARD, &tmp_vol_obj, &loc_params2, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, (vol_obj1 ? vol_obj1->data : NULL), loc_params1) < 0) + if(H5VL_link_create(H5VL_LINK_CREATE_HARD, &tmp_vol_obj, &loc_params2, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, (vol_obj1 ? vol_obj1->data : NULL), &loc_params1) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTCREATE, FAIL, "unable to create hard link") done: @@ -367,7 +367,7 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, tmp_vol_obj.connector = (vol_obj1 != NULL ? vol_obj1->connector : vol_obj2->connector); /* Create a link to the object */ - if(H5VL_link_create(H5VL_LINK_CREATE_HARD, &tmp_vol_obj, &loc_params2, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, vol_obj1->data, loc_params1) < 0) + if(H5VL_link_create(H5VL_LINK_CREATE_HARD, &tmp_vol_obj, &loc_params2, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, vol_obj1->data, &loc_params1) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "unable to create link") done: diff --git a/src/H5VLnative_link.c b/src/H5VLnative_link.c index 4709eb3..5d5935d 100644 --- a/src/H5VLnative_link.c +++ b/src/H5VLnative_link.c @@ -58,15 +58,15 @@ H5VL__native_link_create(H5VL_link_create_type_t create_type, void *obj, H5G_loc_t cur_loc; H5G_loc_t link_loc; void *cur_obj = HDva_arg(arguments, void *); - H5VL_loc_params_t cur_params = HDva_arg(arguments, H5VL_loc_params_t); + H5VL_loc_params_t *cur_params = HDva_arg(arguments, H5VL_loc_params_t *); - if(NULL != cur_obj && H5G_loc_real(cur_obj, cur_params.obj_type, &cur_loc) < 0) + if(NULL != cur_obj && H5G_loc_real(cur_obj, cur_params->obj_type, &cur_loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") if(NULL != obj && H5G_loc_real(obj, loc_params->obj_type, &link_loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object") /* H5Lcreate_hard */ - if(H5VL_OBJECT_BY_NAME == cur_params.type) { + if(H5VL_OBJECT_BY_NAME == cur_params->type) { H5G_loc_t *cur_loc_p, *link_loc_p; /* Set up current & new location pointers */ @@ -80,7 +80,7 @@ H5VL__native_link_create(H5VL_link_create_type_t create_type, void *obj, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should be in the same file.") /* Create the link */ - if((ret_value = H5L_create_hard(cur_loc_p, cur_params.loc_data.loc_by_name.name, + if((ret_value = H5L_create_hard(cur_loc_p, cur_params->loc_data.loc_by_name.name, link_loc_p, loc_params->loc_data.loc_by_name.name, lcpl_id)) < 0) HGOTO_ERROR(H5E_LINK, H5E_CANTINIT, FAIL, "unable to create link") } /* end if */ |