diff options
author | Jan-Willem Blokland <J.W.S.Blokland@XS4All.nl> | 2020-12-02 17:52:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-02 17:52:09 (GMT) |
commit | bf0cbcbea5043fccc1915f8d8b113729accd382a (patch) | |
tree | bf31b4f62a7e2499639b2801b9f452222a2136fe /src/H5T.c | |
parent | c7c1046d492eb3c956868a66a5a66f814808838b (diff) | |
download | hdf5-bf0cbcbea5043fccc1915f8d8b113729accd382a.zip hdf5-bf0cbcbea5043fccc1915f8d8b113729accd382a.tar.gz hdf5-bf0cbcbea5043fccc1915f8d8b113729accd382a.tar.bz2 |
(fix) Segmentation fault when using a compound type. (#143)
* (fix) Segmentation fault when using a compound type.
In the case when a compounded attribute is written to dataset
followed by writing the data with a data transform function
to the dataset will result in a segmentation fault. It turns out
the data is classified as compounded while it is not. Now, the
state is always reset first to not compounded followed by the
existing check if the variable is compounded.
* (fix) Removed undesired comment lines.
* (fix) Segmentation fault when using a compound type: added test.
* (fix) Added the missing cmpd_transform.c file to MANIFEST.
* (fix) cmpd_dtransform test: autotools and source header.
Added the cmp_dtransform test to the autotools configuration and
updated the HDF Group copyright header.
Co-authored-by: Jan-Willem Blokland <Jan-Willem.Blokland@Shell.com>
Diffstat (limited to 'src/H5T.c')
-rw-r--r-- | src/H5T.c | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -3405,8 +3405,8 @@ done: * Note: Common code for both H5T_copy and H5T_copy_reopen, as part of * the const-correct datatype copying routines. * - * Programmer: David Young - * January 18, 2020 + * Programmer: David Young + * January 18, 2020 * *------------------------------------------------------------------------- */ @@ -3453,8 +3453,8 @@ done: * Return: Success: Pointer to a new copy of the OLD_DT argument. * Failure: NULL * - * Programmer: David Young - * January 18, 2020 + * Programmer: David Young + * January 18, 2020 * *------------------------------------------------------------------------- */ @@ -3481,8 +3481,8 @@ done: * Return: Success: Pointer to a new copy of the OLD_DT argument. * Failure: NULL * - * Programmer: David Young - * January 18, 2020 + * Programmer: David Young + * January 18, 2020 * *------------------------------------------------------------------------- */ @@ -3512,8 +3512,8 @@ done: * * Note: Common code for both H5T_copy and H5T_copy_reopen. * - * Programmer: David Young - * January 18, 2020 + * Programmer: David Young + * January 18, 2020 * *------------------------------------------------------------------------- */ @@ -3783,8 +3783,8 @@ done: * Return: Success: Pointer to a new copy of the OLD_DT argument. * Failure: NULL * - * Programmer: David Young - * January 18, 2020 + * Programmer: David Young + * January 18, 2020 * *------------------------------------------------------------------------- */ @@ -5217,7 +5217,10 @@ H5T__path_find_real(const H5T_t *src, const H5T_t *dst, const char *name, H5T_co } /* end else-if */ /* Set the flag to indicate both source and destination types are compound types - * for the optimization of data reading (in H5Dio.c). */ + * for the optimization of data reading (in H5Dio.c). + * Make sure that path->are_compounds is only TRUE for compound types. + */ + path->are_compounds = FALSE; if (H5T_COMPOUND == H5T_get_class(src, TRUE) && H5T_COMPOUND == H5T_get_class(dst, TRUE)) path->are_compounds = TRUE; |