-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 a nil map pointer in mergeEntity. #7711
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chrishoffman
previously approved these changes
Oct 22, 2019
@@ -649,6 +650,9 @@ func (i *IdentityStore) mergeEntity(ctx context.Context, txn *memdb.Txn, toEntit | |||
if ok && !force { | |||
return nil, fmt.Errorf("conflicting MFA config ID %q in entity ID %q", configID, fromEntity.ID) | |||
} else { | |||
if toEntity.MFASecrets == nil { | |||
toEntity.MFASecrets = make(map[string]*mfa.Secret) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the nil check move up to line 649 when you initially check the key?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not an error/panic to read from a nil map, only to write to one.
chrishoffman
approved these changes
Oct 22, 2019
ncabatoff
added a commit
that referenced
this pull request
Oct 22, 2019
briankassouf
pushed a commit
that referenced
this pull request
Oct 23, 2019
catsby
added a commit
that referenced
this pull request
Oct 24, 2019
* master: changelog++ Update CHANGELOG.md Abstract generate-root authentication into the strategy interface (#7698) Changelog: clarify enterprise seal migration fix changelog++ Update transit docs to add aes128/p384/p521 information (#7718) Show versions that are active when delete_version_after is configured (#7685) changelog++ agent: fix data race on inmemSink's token (#7707) Use docker instead of an external LDAP server that sometimes goes down (#7522) changelog++ Fix a nil map pointer in mergeEntity. (#7711) changelog++ TestSysRekey_Verification would fail sometimes when recovery=true (#7710)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was observed to cause a panic during startup in 1.1.3: