From 37c9fd5dda6f7ec08e8aeebae0d7d9512f98f1a5 Mon Sep 17 00:00:00 2001 From: johnlanni Date: Sat, 31 Jan 2026 19:00:58 +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 4d97a09255067..f11d8c8fa7ad3 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 {