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

Fixing atomic bool check #3376

Merged
merged 1 commit into from
Mar 5, 2023
Merged

Conversation

Mzack9999
Copy link
Member

@Mzack9999 Mzack9999 commented Feb 28, 2023

Proposed changes

Fixing return value override due to scan strategy result.
Closes #3338

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@Mzack9999 Mzack9999 added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Feb 28, 2023
@Mzack9999 Mzack9999 self-assigned this Feb 28, 2023
@Mzack9999 Mzack9999 linked an issue Feb 28, 2023 that may be closed by this pull request
Comment on lines +63 to +71
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())
Copy link
Member

@tarunKoyalwar tarunKoyalwar Mar 1, 2023

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()

Copy link
Member

@tarunKoyalwar tarunKoyalwar left a 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

@ehsandeep ehsandeep merged commit 6855069 into dev Mar 5, 2023
@ehsandeep ehsandeep deleted the issue-3338-self-contained-matchers branch March 5, 2023 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No results found error when match found with self-contained template
3 participants