mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 21:45:26 +00:00
Ensure path is resolved before using it
This commit is contained in:
parent
97069afb3c
commit
0983e8b9fa
@ -124,20 +124,20 @@ func (r *Runner) RunEnumeration() {
|
|||||||
|
|
||||||
// parses user input, handle file/directory cases and produce a list of unique templates
|
// parses user input, handle file/directory cases and produce a list of unique templates
|
||||||
for _, t := range r.options.Templates {
|
for _, t := range r.options.Templates {
|
||||||
// determine file/directory
|
// resolve and convert relative to absolute path
|
||||||
isFile, err := isFilePath(t)
|
|
||||||
if err != nil {
|
|
||||||
gologger.Errorf("Could not stat '%s': %s\n", t, err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// convert relative to absolute path
|
|
||||||
absPath, err := r.translateToAbsolutePath(t)
|
absPath, err := r.translateToAbsolutePath(t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
gologger.Errorf("Could not find template file '%s': %s\n", t, err)
|
gologger.Errorf("Could not find template file '%s': %s\n", t, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// determine file/directory
|
||||||
|
isFile, err := isFilePath(absPath)
|
||||||
|
if err != nil {
|
||||||
|
gologger.Errorf("Could not stat '%s': %s\n", absPath, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// test for uniqueness
|
// test for uniqueness
|
||||||
if !isNewPath(absPath, processed) {
|
if !isNewPath(absPath, processed) {
|
||||||
continue
|
continue
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user