From 3b377eb367eb6452d352860f90025eb0f4ec3d31 Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Tue, 11 Jun 2024 20:54:22 +0200 Subject: [PATCH] fixup: reset buffer Signed-off-by: Florian Lehner --- conn_linux.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conn_linux.go b/conn_linux.go index aa55831..c7e44b5 100644 --- a/conn_linux.go +++ b/conn_linux.go @@ -134,6 +134,10 @@ func (c *conn) Receive() ([]Message, error) { bufPtr := c.bufPool.Get().(*[]byte) b := (*bufPtr)[:os.Getpagesize()] defer func() { + // Reset buffer content. + for i := 0; i < len(*bufPtr); i++ { + (*bufPtr)[i] = 0 + } c.bufPool.Put(bufPtr) }()