Skip to content

Commit 79e7168

Browse files
authored
Fix the last valid byte in buf
1 parent 64568ea commit 79e7168

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
@@ -1289,7 +1289,7 @@ H5C__decode_cache_image_header(const H5F_t *f, H5C_t *cache_ptr, const uint8_t *
12891289
p = *buf;
12901290

12911291
/* Ensure buffer has enough data for signature comparison */
1292-
if (H5_IS_BUFFER_OVERFLOW(p, H5C__MDCI_BLOCK_SIGNATURE_LEN, *buf + buf_size))
1292+
if (H5_IS_BUFFER_OVERFLOW(p, H5C__MDCI_BLOCK_SIGNATURE_LEN, *buf + buf_size - 1))
12931293
HGOTO_ERROR(H5E_CACHE, H5E_OVERFLOW, FAIL, "Insufficient buffer size for signature");
12941294

12951295
/* Check signature */

0 commit comments

Comments
 (0)