Skip to content
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

TIKA-4309 -- some mods #1993

Merged
merged 2 commits into from
Oct 16, 2024
Merged

TIKA-4309 -- some mods #1993

merged 2 commits into from
Oct 16, 2024

Conversation

tballison
Copy link
Contributor

@tballison tballison commented Oct 16, 2024

@alexey-pelykh let me know what you think. I probably should have recommended these changes before merging into main... oh well.

I moved the parser into the code module.
I got rid of some of the vars so that we had explicit int vs long.
I used IOUtils.skipFully().

If you can recommend an upper bounds check in the TODO below, that'd be great.

Thank you, again!

@tballison tballison self-assigned this Oct 16, 2024
@@ -48,6 +49,9 @@ public class UniversalExecutableParser implements Parser {
private static final Set<MediaType> SUPPORTED_TYPES =
Collections.singleton(MediaType.application("x-mach-o-universal"));

private static final int MAX_ARCHS_COUNT = 1000;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexey-pelykh are these reasonable limits?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are only 18 known ones and they can't repeat, so I would even say that 19 (to match the "magic detection") would've been another number we could use.

@tballison tballison merged commit f8f9857 into main Oct 16, 2024
1 check passed
@tballison tballison deleted the TIKA-4309-edits branch October 16, 2024 17:47
@tballison
Copy link
Contributor Author

@alexey-pelykh please open a new PR if those hard limits are not reasonable or if you see anything else. Your original patch was really impressive given the, ahem, complexities of Tika. Thank you!

@alexey-pelykh
Copy link
Contributor

I think they are more than generous for real-life usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants