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

lru.Get(): avoid nil pointer dereference #56

Merged
merged 1 commit into from
May 20, 2019

Conversation

kerolasa
Copy link
Contributor

Return failure rather than crash when nil value is inserted as lru data.

Return failure rather than crash when nil value is inserted as lru data.
@hashicorp-cla
Copy link

hashicorp-cla commented May 15, 2019

CLA assistant check
All committers have signed the CLA.

@jefferai
Copy link
Member

Thanks!

@jefferai jefferai merged commit 59383c4 into hashicorp:master May 20, 2019
@kerolasa kerolasa deleted the null-p-dereference branch July 1, 2019 11:25
thaJeztah added a commit to thaJeztah/swarmkit that referenced this pull request Sep 25, 2019
full diff: hashicorp/golang-lru@v0.5.1...v0.5.3

- hashicorp/golang-lru#56 lru.Get(): avoid nil pointer dereference
- hashicorp/golang-lru#57 Adds LRU cache resize
- hashicorp/golang-lru#58 lru: don't kill the return values of Remove and RemoveOldest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/swarmkit that referenced this pull request Sep 25, 2019
full diff: hashicorp/golang-lru@v0.5.1...v0.5.3

- hashicorp/golang-lru#56 lru.Get(): avoid nil pointer dereference
- hashicorp/golang-lru#57 Adds LRU cache resize
- hashicorp/golang-lru#58 lru: don't kill the return values of Remove and RemoveOldest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Oct 23, 2019
full diff: hashicorp/golang-lru@0fb14ef...v0.5.3

- hashicorp/golang-lru#53 remove defer keyword to avoid overhead
- hashicorp/golang-lru#56 lru.Get(): avoid nil pointer dereference
- hashicorp/golang-lru#57 Adds LRU cache resize
- hashicorp/golang-lru#58 lru: don't kill the return values of Remove and RemoveOldest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Oct 24, 2019
full diff: hashicorp/golang-lru@0fb14ef...v0.5.3

- hashicorp/golang-lru#53 remove defer keyword to avoid overhead
- hashicorp/golang-lru#56 lru.Get(): avoid nil pointer dereference
- hashicorp/golang-lru#57 Adds LRU cache resize
- hashicorp/golang-lru#58 lru: don't kill the return values of Remove and RemoveOldest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Dec 10, 2019
full diff: hashicorp/golang-lru@0fb14ef...v0.5.3

- hashicorp/golang-lru#53 remove defer keyword to avoid overhead
- hashicorp/golang-lru#56 lru.Get(): avoid nil pointer dereference
- hashicorp/golang-lru#57 Adds LRU cache resize
- hashicorp/golang-lru#58 lru: don't kill the return values of Remove and RemoveOldest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah added a commit to thaJeztah/cli that referenced this pull request Dec 12, 2019
full diff: hashicorp/golang-lru@0fb14ef...v0.5.3

- hashicorp/golang-lru#53 remove defer keyword to avoid overhead
- hashicorp/golang-lru#56 lru.Get(): avoid nil pointer dereference
- hashicorp/golang-lru#57 Adds LRU cache resize
- hashicorp/golang-lru#58 lru: don't kill the return values of Remove and RemoveOldest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
docker-jenkins pushed a commit to docker-archive/docker-ce that referenced this pull request Jan 6, 2020
full diff: hashicorp/golang-lru@0fb14ef...v0.5.3

- hashicorp/golang-lru#53 remove defer keyword to avoid overhead
- hashicorp/golang-lru#56 lru.Get(): avoid nil pointer dereference
- hashicorp/golang-lru#57 Adds LRU cache resize
- hashicorp/golang-lru#58 lru: don't kill the return values of Remove and RemoveOldest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 4b267469b9b4769ac5f8a2cf3fa5e640efdc201e
Component: cli
@paskal
Copy link
Contributor

paskal commented May 3, 2020

When this situation is happening? Can it be reproduced with test? Is there some reason Peek doesn't have this check?
I've tried to make a test which would trigger this path but I was not able to do that.

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.

4 participants