-
-
Notifications
You must be signed in to change notification settings - Fork 310
Add buffer overflow detection #5884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add buffer overflow detection #5884
Conversation
p += H5C__MDCI_BLOCK_SIGNATURE_LEN; | ||
|
||
/* Check version */ | ||
if (H5_IS_BUFFER_OVERFLOW(p, 1, p_end)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The buffer overflow check above if (H5_IS_BUFFER_OVERFLOW(p, H5C__MDCI_BLOCK_SIGNATURE_LEN, *buf + buf_size - 1))
should probably be updated to make use of p_end
instead for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jhendersonHDF I made the change. Thanks!
This PR hardens H5C__decode_cache_image_header() by adding buffer overflow checks. It doesn't specifically address a CVE issue, but simply responds to this comment in PR #5841.
Important
Add buffer overflow checks to
H5C__decode_cache_image_header()
inH5Cimage.c
for security hardening.H5C__decode_cache_image_header()
inH5Cimage.c
.H5_IS_BUFFER_OVERFLOW()
to verify buffer space before accessing elements.H5C__reconstruct_cache_contents()
to use updated buffer handling logic.This description was created by
for df86e9d. You can customize this summary. It will automatically update as commits are pushed.