Skip to content

Commit

Permalink
Fix typos in comments and fields
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear authored and ccojocar committed Nov 30, 2024
1 parent 229cf63 commit 399e835
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions analyzers/conversion_overflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type rangeResult struct {
type branchResults struct {
minValue *int
maxValue *uint
explixitPositiveVals []uint
explicitPositiveVals []uint
explicitNegativeVals []int
convertFound bool
}
Expand Down Expand Up @@ -336,9 +336,9 @@ func getResultRange(ifInstr *ssa.If, instr *ssa.Convert, visitedIfs map[*ssa.If]
result.maxValue = min(result.maxValue, elseBounds.maxValue)
}

result.explicitPositiveVals = append(result.explicitPositiveVals, thenBounds.explixitPositiveVals...)
result.explicitPositiveVals = append(result.explicitPositiveVals, thenBounds.explicitPositiveVals...)
result.explicitNegativeVals = append(result.explicitNegativeVals, thenBounds.explicitNegativeVals...)
result.explicitPositiveVals = append(result.explicitPositiveVals, elseBounds.explixitPositiveVals...)
result.explicitPositiveVals = append(result.explicitPositiveVals, elseBounds.explicitPositiveVals...)
result.explicitNegativeVals = append(result.explicitNegativeVals, elseBounds.explicitNegativeVals...)

return result
Expand Down Expand Up @@ -451,7 +451,7 @@ func walkBranchForConvert(block *ssa.BasicBlock, instr *ssa.Convert, visitedIfs
if result.isRangeCheck {
bounds.minValue = toPtr(max(result.minValue, bounds.minValue))
bounds.maxValue = toPtr(min(result.maxValue, bounds.maxValue))
bounds.explixitPositiveVals = append(bounds.explixitPositiveVals, result.explicitPositiveVals...)
bounds.explicitPositiveVals = append(bounds.explicitPositiveVals, result.explicitPositiveVals...)
bounds.explicitNegativeVals = append(bounds.explicitNegativeVals, result.explicitNegativeVals...)
}
case *ssa.Call:
Expand Down
4 changes: 2 additions & 2 deletions analyzers/hardcoded_nonce.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ func iterateThroughReferrers(variable ssa.Value, funcsToTrack map[string][]int,
if refs == nil {
return gosecIssues, nil
}
// Go trough all functions that use the given arg variable
// Go through all functions that use the given arg variable
for _, ref := range *refs {
// Iterate trough the functions we are interested
// Iterate through the functions we are interested
for trackedFunc := range funcsToTrack {

// Split the functions we are interested in, by the '.' because we will use the function name to do the comparison
Expand Down
2 changes: 1 addition & 1 deletion rules/fileperms.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (r *osCreatePermissions) Match(n ast.Node, c *gosec.Context) (*issue.Issue,
return nil, nil
}

// NewOsCreatePerms reates a rule to detect file creation with a more permissive than configured
// NewOsCreatePerms creates a rule to detect file creation with a more permissive than configured
// permission mask.
func NewOsCreatePerms(id string, conf gosec.Config) (gosec.Rule, []ast.Node) {
mode := getConfiguredMode(conf, id, 0o666)
Expand Down

0 comments on commit 399e835

Please sign in to comment.