From 7da37c57c59868eccee7f0a44edff2ff590fd9aa Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Sun, 12 Nov 2023 09:02:32 +1300 Subject: [PATCH] Chore: Use NextReader() instead of ReadMessage() for websocket reading (#207) This prevents against malicious buffer overflows. --- server/websockets/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/websockets/client.go b/server/websockets/client.go index efbc634df..ddefa1ff0 100644 --- a/server/websockets/client.go +++ b/server/websockets/client.go @@ -60,7 +60,7 @@ func (c *Client) readPump() { }() for { - _, _, err := c.conn.ReadMessage() + _, _, err := c.conn.NextReader() if err != nil { if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway, websocket.CloseAbnormalClosure) { logger.Log().Errorf("[websocket] error: %v", err)