From 21cfa806fae9f6a9cc14e2281ad497f6fd82f449 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..8f63dbd 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(b); i++ { + b[i] = 0 + } c.bufPool.Put(bufPtr) }()