fido: VirtualFidoDiscoveryFactory fixes
CreateAuthenticator() relies on VirtualAuthenticator IDs being unique, which they are. But if they weren't, it would first dereference and then return a dangling VirtualAuthenticator pointer. Since a similar code piece has recently shown that same bug, make this method more defensive so it doesn't regress under future changes. Also fix a possible nullptr dereference. Change-Id: Ia769929f94360eabcdadb5e0f706f83d031231f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2209905 Commit-Queue: Martin Kreichgauer <martinkr@google.com> Auto-Submit: Martin Kreichgauer <martinkr@google.com> Reviewed-by:Nina Satragno <nsatragno@chromium.org> Cr-Commit-Position: refs/heads/master@{#770768}
Showing
Please register or sign in to comment