• Martin Kreichgauer's avatar
    fido: VirtualFidoDiscoveryFactory fixes · 2312af4d
    Martin Kreichgauer authored
    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: default avatarNina Satragno <nsatragno@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#770768}
    2312af4d
virtual_fido_discovery_factory.cc 5.48 KB