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(filesystem/iso9660): fix bug when compare null bytes #93

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

t3ls
Copy link

@t3ls t3ls commented Feb 4, 2021

"Unable to convert expiration date/time from bytes" was raised when parse some specific iso9660 images, eg:

https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/xenial/ubuntu-16.04.7-server-amd64.iso

@deitch
Copy link
Collaborator

deitch commented Feb 4, 2021

Would you please update the description as to why this is necessary? When does the slice given by nullBytes (16 of 48 followed by 0) not match appropriately?

Copy link
Collaborator

@deitch deitch left a comment

Choose a reason for hiding this comment

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

In addition to the comment in the PR, please:

  • create a single var of alternate nullBytes and compare it, rather than building each time, something like: nullBytesAlt := bytes.Repeat([]byte{0}, len(nullBytes)) and then use that in the bytes.Compare
  • describe in a comment right above that when it is necessary

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