Skip to content

mountinfo.GetMountsFromReader() use strings.SplitN()#76

Merged
AkihiroSuda merged 1 commit intomoby:masterfrom
thaJeztah:mountinfo_splitn
Aug 23, 2021
Merged

mountinfo.GetMountsFromReader() use strings.SplitN()#76
AkihiroSuda merged 1 commit intomoby:masterfrom
thaJeztah:mountinfo_splitn

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

We expect 2 fields to be there, anything below (or above) will produce
an error, so limit the number of strings we split into to 3. This still
allows us to detect "too many colons", but won't result in splitting
without bounds.

We expect 2 fields to be there, anything below (or above) will produce
an error, so limit the number of strings we split into to 3. This still
allows us to detect "too many colons", but won't result in splitting
without bounds.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah requested a review from kolyshkin August 7, 2021 12:48
Copy link
Copy Markdown
Collaborator

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Copy Markdown
Member Author

@AkihiroSuda ptal

@AkihiroSuda AkihiroSuda merged commit 79f347c into moby:master Aug 23, 2021
@thaJeztah thaJeztah deleted the mountinfo_splitn branch August 23, 2021 12:22
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.

3 participants