Skip to content

Commit 27bc5a6

Browse files
committed
fix nil pointer deref
1 parent a42ebf6 commit 27bc5a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

config/target.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ func tlsVersionStringToUint(v string) uint16 {
243243
}
244244

245245
func loadCerts(tlscfg *tls.Config, tc *TargetConfig) error {
246-
if *tc.TLSCert != "" && *tc.TLSKey != "" {
246+
if (tc.TLSCert != nil && *tc.TLSCert != "") && (tc.TLSKey != nil && *tc.TLSKey != "") {
247247
certificate, err := tls.LoadX509KeyPair(*tc.TLSCert, *tc.TLSKey)
248248
if err != nil {
249249
return err

0 commit comments

Comments
 (0)