Skip to content

Commit 2d5377d

Browse files
authored
use H5_IS_BUFFER_OVERFLOW to check overflow
1 parent 8cebb9c commit 2d5377d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/H5Cimage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, const uint8_t *
12881288
p = *buf;
12891289

12901290
/* Ensure buffer has enough data for signature comparison */
1291-
if ((size_t)(*buf + H5C__MDCI_BLOCK_SIGNATURE_LEN - p) > cache_ptr->image_len)
1291+
if (H5_IS_BUFFER_OVERFLOW(p, H5C__MDCI_BLOCK_SIGNATURE_LEN, *buf + cache_ptr->image_len))
12921292
HGOTO_ERROR(H5E_CACHE, H5E_OVERFLOW, FAIL, "Insufficient buffer size for signature");
12931293

12941294
/* Check signature */

0 commit comments

Comments
 (0)