From 8eb3cfe1444afc8217a9e11373957eba828669ea Mon Sep 17 00:00:00 2001 From: cty123 Date: Sat, 15 Jul 2023 23:58:08 +0200 Subject: [PATCH] fix: Patch potential nil pointer deference in proxy::http::client::fillRequestHeader(). --- proxy/http/client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/proxy/http/client.go b/proxy/http/client.go index b1661011..f597a502 100644 --- a/proxy/http/client.go +++ b/proxy/http/client.go @@ -172,6 +172,10 @@ func fillRequestHeader(ctx context.Context, header []*Header) ([]*Header, error) inbound := session.InboundFromContext(ctx) outbound := session.OutboundFromContext(ctx) + if inbound == nil || outbound == nil { + return nil, newError("missing inbound or outbound metadata from context") + } + data := struct { Source net.Destination Target net.Destination