mirror of https://github.com/daffainfo/nuclei.git
Fixing atomic bool check (#3376)
parent
d7ac306bdf
commit
68550695f8
|
@ -60,13 +60,16 @@ func (e *Engine) ExecuteScanWithOpts(templatesList []*templates.Template, target
|
|||
// Execute All SelfContained in parallel
|
||||
e.executeAllSelfContained(selfContained, results, selfcontainedWg)
|
||||
|
||||
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())
|
||||
|
||||
selfcontainedWg.Wait()
|
||||
return results
|
||||
}
|
||||
|
|
|
@ -13,9 +13,7 @@ import (
|
|||
"github.com/remeh/sizedwaitgroup"
|
||||
)
|
||||
|
||||
/*
|
||||
Executors are low level executors that deals with template execution on a target
|
||||
*/
|
||||
// Executors are low level executors that deals with template execution on a target
|
||||
|
||||
// executeAllSelfContained executes all self contained templates that do not use `target`
|
||||
func (e *Engine) executeAllSelfContained(alltemplates []*templates.Template, results *atomic.Bool, sg *sync.WaitGroup) {
|
||||
|
|
Loading…
Reference in New Issue