mirror of https://github.com/daffainfo/nuclei.git
Additional nil check on interactsh client (#3590)
parent
97e7081c69
commit
ea5f8a0638
|
@ -1,6 +1,7 @@
|
||||||
package interactsh
|
package interactsh
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"regexp"
|
"regexp"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
@ -8,6 +9,8 @@ import (
|
||||||
var (
|
var (
|
||||||
defaultInteractionDuration = 60 * time.Second
|
defaultInteractionDuration = 60 * time.Second
|
||||||
interactshURLMarkerRegex = regexp.MustCompile(`{{interactsh-url(?:_[0-9]+){0,3}}}`)
|
interactshURLMarkerRegex = regexp.MustCompile(`{{interactsh-url(?:_[0-9]+){0,3}}}`)
|
||||||
|
|
||||||
|
ErrInteractshClientNotInitialized = errors.New("interactsh client not initialized")
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -202,9 +202,14 @@ func (c *Client) URL() (string, error) {
|
||||||
err = c.poll()
|
err = c.poll()
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errorutil.NewWithErr(err).Msgf("interactsh client not initialized")
|
return "", errorutil.NewWithErr(err).Wrap(ErrInteractshClientNotInitialized)
|
||||||
|
}
|
||||||
|
// ensures interactsh is not nil
|
||||||
|
if c.interactsh == nil {
|
||||||
|
return "", ErrInteractshClientNotInitialized
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
c.generated.Store(true)
|
c.generated.Store(true)
|
||||||
return c.interactsh.URL(), nil
|
return c.interactsh.URL(), nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue