Skip to content

Commit

Permalink
Merge pull request #403 from BishopFox/fix/dnscrash
Browse files Browse the repository at this point in the history
Ensure dnsSession is not nil before using it
  • Loading branch information
rkervella authored Apr 21, 2021
2 parents 32a3305 + e4bdad2 commit ba43f1d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/c2/udp-dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,10 @@ func dnsSessionPoll(domain string, fields []string) ([]string, error) {
return []string{"1"}, errors.New("invalid session id (session poll)")
}
dnsSessionsMutex.Lock()
dnsSession := (*dnsSessions)[sessionID]
dnsSession, found := (*dnsSessions)[sessionID]
if !found {
return []string{"1"}, errors.New("invalid session (nil pointer")
}
dnsSessionsMutex.Unlock()

isDrained := false
Expand Down

0 comments on commit ba43f1d

Please sign in to comment.