Skip to content

Commit

Permalink
Merge pull request #6 from github/uint-lint-fix
Browse files Browse the repository at this point in the history
Fix triangle count validation in WriteSTLBinary function
  • Loading branch information
chrisreddington authored Nov 25, 2024
2 parents c7ca274 + 5e0ccba commit cde1ef1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stl/stl.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func WriteSTLBinary(filename string, triangles []types.Triangle) error {
}

triangleCount := len(triangles)
if triangleCount < 0 || triangleCount > math.MaxUint32 {
if triangleCount < 0 {
return errors.New(errors.ValidationError, "invalid number of triangles for STL format", nil)
}
if err := writeTriangleCount(writer, uint32(triangleCount)); err != nil {
Expand Down

0 comments on commit cde1ef1

Please sign in to comment.