Skip to content

Commit cddc3cf

Browse files
fix st nil ptr deref (#1140)
1 parent d9a9571 commit cddc3cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

v2/pkg/subscraping/sources/securitytrails/securitytrails.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
jsoniter "github.com/json-iterator/go"
1313

1414
"github.com/projectdiscovery/subfinder/v2/pkg/subscraping"
15+
"github.com/projectdiscovery/utils/ptr"
1516
)
1617

1718
type response struct {
@@ -66,7 +67,7 @@ func (s *Source) Run(ctx context.Context, domain string, session *subscraping.Se
6667
resp, err = session.Get(ctx, fmt.Sprintf("https://api.securitytrails.com/v1/scroll/%s", scrollId), "", headers)
6768
}
6869

69-
if err != nil && resp.StatusCode == 403 {
70+
if err != nil && ptr.Safe(resp).StatusCode == 403 {
7071
resp, err = session.Get(ctx, fmt.Sprintf("https://api.securitytrails.com/v1/domain/%s/subdomains", domain), "", headers)
7172
}
7273

0 commit comments

Comments
 (0)