summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan-Willem Blokland <J.W.S.Blokland@XS4All.nl>2020-12-02 17:52:09 (GMT)
committerGitHub <noreply@github.com>2020-12-02 17:52:09 (GMT)
commitbf0cbcbea5043fccc1915f8d8b113729accd382a (patch)
treebf31b4f62a7e2499639b2801b9f452222a2136fe /src
parentc7c1046d492eb3c956868a66a5a66f814808838b (diff)
downloadhdf5-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')
-rw-r--r--src/H5T.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/H5T.c b/src/H5T.c
index 7a81542..6c2c6b9 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -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;