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

fix: avoid use-after-move StatusOr #7635

Merged
merged 3 commits into from
Nov 19, 2021

Commits on Nov 19, 2021

  1. fix: avoid use-after-move StatusOr

    Similar to: googleapis#7588
    
    This code allowed callers to (rightfully) move-out the `StatusOr` that
    was held in `current_`. Therefore, it's a bug if we then consult the
    status of `current_.ok()`, because it may be in a moved-from state.
    
    The fix is to track the `current_ok_` bit separately, so that we only
    ever assign to `current_` and never read it after it could have been
    moved.
    devjgm committed Nov 19, 2021
    Configuration menu
    Copy the full SHA
    15f5ba0 View commit details
    Browse the repository at this point in the history
  2. moved assignment

    devjgm committed Nov 19, 2021
    Configuration menu
    Copy the full SHA
    3b32cc9 View commit details
    Browse the repository at this point in the history
  3. PR comments

    devjgm committed Nov 19, 2021
    Configuration menu
    Copy the full SHA
    8477b5f View commit details
    Browse the repository at this point in the history