Skip to content

Commit 21cfa80

Browse files
committed
fixup: reset buffer
Signed-off-by: Florian Lehner <[email protected]>
1 parent 2aa3dbc commit 21cfa80

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

conn_linux.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ func (c *conn) Receive() ([]Message, error) {
134134
bufPtr := c.bufPool.Get().(*[]byte)
135135
b := (*bufPtr)[:os.Getpagesize()]
136136
defer func() {
137+
// Reset buffer content.
138+
for i := 0; i < len(b); i++ {
139+
b[i] = 0
140+
}
137141
c.bufPool.Put(bufPtr)
138142
}()
139143

0 commit comments

Comments
 (0)