Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pkg/lisafs/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package lisafs

import (
"fmt"
"math"
"os"
"strings"

Expand Down Expand Up @@ -304,7 +303,7 @@ func WalkHandler(c *Connection, comm Communicator, payloadLen uint32) (uint32, e
)
respMetaSize := status.SizeBytes() + numInodes.SizeBytes()
maxPayloadSize := respMetaSize + (len(req.Path) * (*Inode)(nil).SizeBytes())
if maxPayloadSize > math.MaxUint32 {
if maxPayloadSize > int(c.maxMessageSize) {
// Too much to walk, can't do.
return 0, unix.EIO
}
Expand Down Expand Up @@ -406,7 +405,7 @@ func WalkStatHandler(c *Connection, comm Communicator, payloadLen uint32) (uint3
// the same as WalkStatResp's.
var numStats primitive.Uint16
maxPayloadSize := numStats.SizeBytes() + (len(req.Path) * SizeOfStatx)
if maxPayloadSize > math.MaxUint32 {
if maxPayloadSize > int(c.maxMessageSize) {
// Too much to walk, can't do.
return 0, unix.EIO
}
Expand Down