-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Fixing atomic bool check #3376
Fixing atomic bool check #3376
Conversation
var strategyResult *atomic.Bool | ||
switch e.options.ScanStrategy { | ||
case "template-spray": | ||
results = e.executeTemplateSpray(filtered, target) | ||
strategyResult = e.executeTemplateSpray(filtered, target) | ||
case "host-spray": | ||
results = e.executeHostSpray(filtered, target) | ||
strategyResult = e.executeHostSpray(filtered, target) | ||
} | ||
|
||
results.CompareAndSwap(false, strategyResult.Load()) |
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.
@Mzack9999 what do you think of adding default
case to switch case . if someone is using nuclei sdk and scanstrategy is empty or different it will panic due to strategyResult.Load()
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.
lgtm! approved with a comment
Proposed changes
Fixing return value override due to scan strategy result.
Closes #3338
Checklist