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 failing decode of credentials #1

Merged
merged 1 commit into from
Aug 5, 2021

Conversation

wndhydrnt
Copy link
Contributor

We experienced an issue where this library failed to read some credentials. The credentials are set via docker login.

The check that compares the number of written bytes with the maximum length in bytes is too restrictive.
The Docker CLI implements the check a bit differently (link to source).

This change aligns the check with what the Docker CLI is doing.

Copy link
Owner

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

Reading the docs I see DecodeLen is the max size it could be not the actual size.
So LGTM.

I don't think we can ever hit the n > decodeLen case because it can't be longer than the buffer we pass in, which is the max size it could possibly be anyway.
But this is fine as is.

@cpuguy83 cpuguy83 merged commit 3ee4ae1 into cpuguy83:main Aug 5, 2021
@cpuguy83
Copy link
Owner

cpuguy83 commented Aug 5, 2021

Added a v0.3.1 tag.

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