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

LoadCCache does not check file length #524

Open
hwipl opened this issue Jul 5, 2023 · 0 comments · May be fixed by #525
Open

LoadCCache does not check file length #524

hwipl opened this issue Jul 5, 2023 · 0 comments · May be fixed by #525

Comments

@hwipl
Copy link

hwipl commented Jul 5, 2023

Currently, the LoadCCache() function does not check the length of the credentials cache file. This causes a panic in Unmarshal()
when parsing a short ccache file like, e.g., an empty file.

LoadCCache() already handles file reading errors returned by os.ReadFile(). So, it could be useful to also check a minimum ccache file length and return an error in case of a short file to avoid the panic. I'll open a PR with a suggestion. I hope, that's OK :)

@hwipl hwipl linked a pull request Jul 5, 2023 that will close this issue
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 a pull request may close this issue.

1 participant