Skip to content

Fixed parsing of boundary patches from binary format #51

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

filippo-biondi
Copy link
Contributor

Since the end of boundary patches in binary file was checked by stripping the line and checking if the result was equal to '}' it was possible that the end of a patch was miss-detected, since a '}' surrounded by characters that are removed by the strip function could appear randomly in the binary content (and indeed happened in my case ).

I updated the check to remove only withe spaces, tabs and new lines in the stripping operation and check for the ');' characters at the end of the previous line to determine if the actual end of the boundary patch is reached.

I think its theoretically possible that the end of a patch is still miss-detected (since a ');' followed on the next line by a '}' surrounded by tabs or withe-spaces could still appear randomly in the binary content) but it's much more unlikely.

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.

1 participant