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

fix: panic on json encoding #845

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/amass/enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,8 @@ func saveJSONOutput(e *enum.Enumeration, args *enumArgs, output chan *requests.O
// Save all the output returned by the enumeration
for out := range output {
// Handle encoding the result as JSON
out.Mu.Lock()
defer out.Mu.Unlock()
_ = enc.Encode(out)
}
}
Expand Down
2 changes: 2 additions & 0 deletions requests/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net"
"strings"
"time"
"sync"

amassdns "github.com/OWASP/Amass/v3/net/dns"
"github.com/caffix/pipeline"
Expand Down Expand Up @@ -288,6 +289,7 @@ type WhoisRequest struct {

// Output contains all the output data for an enumerated DNS name.
type Output struct {
Mu sync.Mutex
Name string `json:"name"`
Domain string `json:"domain"`
Addresses []AddressInfo `json:"addresses"`
Expand Down