Skip to content

Commit

Permalink
fix(gateway): bound negative indexes to size of file
Browse files Browse the repository at this point in the history
when using entity-bytes with a file and a negative start range, insure that ranges more negative
than the file's length are bounded at zero
  • Loading branch information
hannahhoward authored and lidel committed Jan 23, 2024
1 parent 4c3a1f2 commit b075490
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gateway/blocks_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,9 @@ func walkGatewaySimpleSelector(ctx context.Context, p path.ImmutablePath, params
return err
}
from = fileLength + entityRange.From
if from < 0 {
from = 0
}
foundFileLength = true
}

Expand Down

0 comments on commit b075490

Please sign in to comment.