Skip to content

Commit

Permalink
more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Pickett committed Apr 12, 2024
1 parent 47e3fc0 commit a324923
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
3 changes: 0 additions & 3 deletions boxer.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ func (boxer boxMaker) DecodeUnverified(b64 string) (*Box, error) {
return nil, fmt.Errorf("decoding base64: %w", err)
}

// Limit size to prevent garbage from filling memory
if len(data) > V0MaxSize {
return nil, fmt.Errorf("data too big, is %d, max is %d", len(data), V0MaxSize)
}
Expand Down Expand Up @@ -202,7 +201,6 @@ func (boxer boxMaker) DecodePngUnverified(r io.Reader) (*Box, error) {
return nil, fmt.Errorf("decoding png: %w", err)
}

// Limit size to prevent garbage from filling memory
if data.Len() > V0MaxSize {
return nil, errors.New("looks to be larger than max box size")
}
Expand All @@ -211,7 +209,6 @@ func (boxer boxMaker) DecodePngUnverified(r io.Reader) (*Box, error) {
}

func (boxer boxMaker) DecodeRaw(data []byte) (*Box, error) {
// Limit size to prevent garbage from filling memory
if len(data) > V0MaxSize {
return nil, fmt.Errorf("data too big, is %d, max is %d", len(data), V0MaxSize)
}
Expand Down
1 change: 0 additions & 1 deletion pkg/challenge/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ type InnerResponse struct {
}

func UnmarshalResponse(outerResponseBytes []byte) (*OuterResponse, error) {
// Limit size to prevent garbage from filling memory
if len(outerResponseBytes) > krypto.V0MaxSize {
return nil, fmt.Errorf("response to large: is %d, max is %d", len(outerResponseBytes), krypto.V0MaxSize)
}
Expand Down

0 comments on commit a324923

Please sign in to comment.