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 possible use-before-assign bug #3505

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

webbnh
Copy link
Member

@webbnh webbnh commented Jul 26, 2023

In the Cache Manager make_cache_object() function there is a possible use-before-assignment hazard. This PR addresses that by ensuring that, in the unlikely event that the assignment fails, we won't execute the use.

(This was a part of #3501, but I decided to pull it out into its own PR.)

@webbnh webbnh added the Server label Jul 26, 2023
@webbnh webbnh added this to the v0.73 milestone Jul 26, 2023
@webbnh webbnh requested review from ndokos and dbutenhof July 26, 2023 19:08
@webbnh webbnh self-assigned this Jul 26, 2023
Copy link
Member

@dbutenhof dbutenhof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems unlikely that we could hit an exception on the statement you moved; but moving it outside of the try makes me inexplicably nervous anyway. 😆

lib/pbench/server/cache_manager.py Show resolved Hide resolved
@webbnh webbnh merged commit db87083 into distributed-system-analysis:main Jul 27, 2023
@webbnh webbnh deleted the use_before_init_bug branch July 27, 2023 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants