From 179318a38cb31bfd00f476cf1f3a1c9493dbc27a Mon Sep 17 00:00:00 2001 From: johnlanni Date: Sat, 31 Jan 2026 19:20:22 +0800 Subject: [PATCH] fix: prevent nil pointer dereference in envoyGoFilterOnHttpData Replace getState() with getOrCreateState() to handle cases where OnHttpData is called before OnHttpHeader, preventing SIGSEGV panic when s.req is not yet initialized. Fixes: panic: runtime error: invalid memory address or nil pointer dereference --- contrib/golang/filters/http/source/go/pkg/http/shim.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/golang/filters/http/source/go/pkg/http/shim.go b/contrib/golang/filters/http/source/go/pkg/http/shim.go index ea3830e08237c..527df10692531 100644 --- a/contrib/golang/filters/http/source/go/pkg/http/shim.go +++ b/contrib/golang/filters/http/source/go/pkg/http/shim.go @@ -236,7 +236,7 @@ func envoyGoFilterOnHttpHeader(s *C.processState, endStream, headerNum, headerBy //export envoyGoFilterOnHttpData func envoyGoFilterOnHttpData(s *C.processState, endStream, buffer, length uint64) uint64 { - state := getState(s) + state := getOrCreateState(s) req := state.request if req.pInfo.paniced {