mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
Fix range check in H5_addr_overlap (#4278)
When the H5_addr_overlap macro was updated to use H5_RANGE_OVERLAP, it failed to take into account that H5_RANGE_OVERLAP expects the range to be inclusive. This lead to an assertion failure in H5MM_memcpy due to a memcpy operation on overlapping memory. This has been fixed by subtracting 1 from the calculated high bound values passed to H5_RANGE_OVERLAP
This commit is contained in:
parent
16ba713e31
commit
98c19af7c8
@ -479,7 +479,7 @@
|
||||
(X) >= (Y))
|
||||
#define H5_addr_cmp(X,Y) (H5_addr_eq((X), (Y)) ? 0 : \
|
||||
(H5_addr_lt((X), (Y)) ? -1 : 1))
|
||||
#define H5_addr_overlap(O1,L1,O2,L2) H5_RANGE_OVERLAP(O1, ((O1)+(L1)), O2, ((O2)+(L2)))
|
||||
#define H5_addr_overlap(O1,L1,O2,L2) H5_RANGE_OVERLAP(O1, ((O1)+(L1)-1), O2, ((O2)+(L2)-1))
|
||||
/* clang-format on */
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user