mirror of
https://github.com/XTLS/RealiTLScanner.git
synced 2026-09-22 22:28:08 +03:00
fix: nil pointer dereference in ScanTLS when no cert has DNSNames
This commit is contained in:
committed by
yuhan6665
parent
41de84143e
commit
fadc01890d
+1
-2
@@ -2,7 +2,6 @@ package main
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"log/slog"
|
||||
"net"
|
||||
"strconv"
|
||||
@@ -50,7 +49,7 @@ func ScanTLS(host Host, out chan<- string, geo *Geo) {
|
||||
domain := state.PeerCertificates[0].Subject.CommonName
|
||||
issuers := strings.Join(state.PeerCertificates[0].Issuer.Organization, " | ")
|
||||
length := 0
|
||||
var leaf *x509.Certificate
|
||||
leaf := state.PeerCertificates[0]
|
||||
for _, cert := range state.PeerCertificates {
|
||||
length += len(cert.Raw)
|
||||
if len(cert.DNSNames) != 0 {
|
||||
|
||||
Reference in New Issue
Block a user