Skip to content

Commit 7aeca33

Browse files
cty123yuhan6665
authored andcommitted
fix: revert previous change on IsValid() function; add validation in getUoTConnection();
1 parent 2df418a commit 7aeca33

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

app/proxyman/outbound/uot.go

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import (
1111
)
1212

1313
func (h *Handler) getUoTConnection(ctx context.Context, dest net.Destination) (stat.Connection, error) {
14+
if dest.Address == nil {
15+
return nil, newError("nil destination address")
16+
}
1417
if !dest.Address.Family().IsDomain() {
1518
return nil, os.ErrInvalid
1619
}

common/net/destination.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (d Destination) String() string {
113113

114114
// IsValid returns true if this Destination is valid.
115115
func (d Destination) IsValid() bool {
116-
return d.Address != nil && d.Network != Network_Unknown
116+
return d.Network != Network_Unknown
117117
}
118118

119119
// AsDestination converts current Endpoint into Destination.

0 commit comments

Comments
 (0)