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

Fix leading zeros in parser.etw.core.Guid.__str__ #1

Merged
merged 1 commit into from Apr 20, 2020

Conversation

g12-al
Copy link
Contributor

@g12-al g12-al commented Apr 14, 2020

In the last section of the str method for the Guid class, string padding to the correct hex length is not performed.

If you are comparing a guid which requires zero padding, e.g. *-d312ba227f03, this method will NOT include the 0, causing it to be *-d312ba227f3 (missing zero at the end). If you want to compare string-representations of GUIDs, this code segment will cause you problems.

The fix is simple, in the string-ify operation, simply force the hex character to be printed as exactly two characters, so that zero is always included

In the last section of the __str__ method for the Guid class, string padding to the correct hex length is not performed.

If you are comparing a guid which requires zero padding, e.g. *-d312ba227f03, this method will NOT include the 0, causing it to be *-d312ba227f3 (missing zero at the end). If you want to compare string-representations of GUIDs, this code segment will cause you problems.

The fix is simple, in the string-ify operation, simply force the hex character to be printed as exactly two characters, so that zero is always included
@citronneur citronneur merged commit d095514 into airbus-cert:master Apr 20, 2020
@citronneur
Copy link
Member

Thanks a lot !!!

@g12-al
Copy link
Contributor Author

g12-al commented Apr 22, 2020

Thank you for implementing this library! :)

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.

None yet

2 participants