-
-
Notifications
You must be signed in to change notification settings - Fork 312
Fix CVE-2025-2925 #5739
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
Fix CVE-2025-2925 #5739
Changes from 6 commits
c731305
e5247be
363d37c
21d8fc7
831fad6
15da7a3
2f5a1ee
58cc0a3
cdfdc51
d7e66e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to remove the changes to this file |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1052,9 +1052,14 @@ H5C__load_entry(H5F_t *f, | |
| */ | ||
| do { | ||
| if (actual_len != len) { | ||
| /* Verify that the length isn't a bad value */ | ||
| if (len == 0) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jhendersonHDF Does len need to be traced back to where it was obtained and caught there? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That could be useful to do in addition to these checks, though catching it at this level will probably cover a wider range of issues. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both would be good |
||
| HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "len is a bad value"); | ||
|
|
||
| if (NULL == (new_image = H5MM_realloc(image, len + H5C_IMAGE_EXTRA_SPACE))) | ||
| HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "image null after H5MM_realloc()"); | ||
| image = (uint8_t *)new_image; | ||
|
|
||
| #if H5C_DO_MEMORY_SANITY_CHECKS | ||
| H5MM_memcpy(image + len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); | ||
| #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ | ||
|
|
@@ -1105,10 +1110,15 @@ H5C__load_entry(H5F_t *f, | |
| if (H5C__verify_len_eoa(f, type, addr, &actual_len, true) < 0) | ||
| HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "actual_len exceeds EOA"); | ||
|
|
||
| /* Verify that the length isn't 0 */ | ||
| if (actual_len == 0) | ||
| HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "actual_len is a bad value"); | ||
|
|
||
| /* Expand buffer to new size */ | ||
| if (NULL == (new_image = H5MM_realloc(image, actual_len + H5C_IMAGE_EXTRA_SPACE))) | ||
| HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "image null after H5MM_realloc()"); | ||
| image = (uint8_t *)new_image; | ||
|
|
||
| #if H5C_DO_MEMORY_SANITY_CHECKS | ||
| H5MM_memcpy(image + actual_len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE); | ||
| #endif /* H5C_DO_MEMORY_SANITY_CHECKS */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.