Skip to content

Commit 8eb3cfe

Browse files
cty123yuhan6665
authored andcommitted
fix: Patch potential nil pointer deference in proxy::http::client::fillRequestHeader().
1 parent 929f286 commit 8eb3cfe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

proxy/http/client.go

+4
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ func fillRequestHeader(ctx context.Context, header []*Header) ([]*Header, error)
172172
inbound := session.InboundFromContext(ctx)
173173
outbound := session.OutboundFromContext(ctx)
174174

175+
if inbound == nil || outbound == nil {
176+
return nil, newError("missing inbound or outbound metadata from context")
177+
}
178+
175179
data := struct {
176180
Source net.Destination
177181
Target net.Destination

0 commit comments

Comments
 (0)