Skip to content

Commit

Permalink
fixup: reset buffer
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Lehner <[email protected]>
  • Loading branch information
florianl committed Jun 11, 2024
1 parent 2aa3dbc commit 21cfa80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions conn_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}()

Expand Down

0 comments on commit 21cfa80

Please sign in to comment.