Skip to content

Commit

Permalink
Chore: Use NextReader() instead of ReadMessage() for websocket reading (
Browse files Browse the repository at this point in the history
#207)

This prevents against malicious buffer overflows.
  • Loading branch information
axllent committed Nov 11, 2023
1 parent 61c8a05 commit 7da37c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/websockets/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7da37c5

Please sign in to comment.