libatalk: fix parsing of macOS created AppleDouble files #575
+7
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
header_len is just AD_DATASZ_OSX which is 82. Pass the size of the AppleDouble file to parse_entries() so the bound checks correctly work with the file size, not just the header size.
With an FinderInfo AppleDouble entry that contains embedded xattrs, the FinderInfo entry will be much larger then 32 bytes, typically it looks like this:
Entry ID : 00000009 : Finder Info
Offset : 00000032 : 50
Length : 00000EB0 : 3760
As offset + length is bigger then FinderInfo, parse_entries() fails the validation.
Signed-off-by: Ralph Boehme [email protected]
Reviewed-by: Daniel Markstedt [email protected]