Skip to content
Snippets Groups Projects
Commit f23bc456 authored by Brian Carrier's avatar Brian Carrier Committed by GitHub
Browse files

Merge pull request #812 from uckelman-sf/hfs-attr-bounds

Improved HFS attr data bounds checking
parents 4a4dd764 c2284f56
No related branches found
No related tags found
No related merge requests found
...@@ -3781,6 +3781,14 @@ hfs_load_extended_attrs(TSK_FS_FILE * fs_file, ...@@ -3781,6 +3781,14 @@ hfs_load_extended_attrs(TSK_FS_FILE * fs_file,
// This is the length of the useful data, not including the record header // This is the length of the useful data, not including the record header
attributeLength = tsk_getu32(endian, attrData->attr_size); attributeLength = tsk_getu32(endian, attrData->attr_size);
// Check the attribute fits in the node
//if (recordType != HFS_ATTR_RECORD_INLINE_DATA) {
if (recOffset + keyLength + 2 + attributeLength > attrFile.nodeSize) {
error_detected(TSK_ERR_FS_READ,
"hfs_load_extended_attrs: Unable to process attribute");
goto on_error;
}
buffer = malloc(attributeLength); buffer = malloc(attributeLength);
if (buffer == NULL) { if (buffer == NULL) {
error_detected(TSK_ERR_AUX_MALLOC, error_detected(TSK_ERR_AUX_MALLOC,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment