1
0
mirror of https://github.com/securego/gosec.git synced 2024-12-24 20:14:32 +02:00

Fix typos in comments and fields

This commit is contained in:
Oleksandr Redko 2024-11-30 00:46:31 +02:00 committed by Cosmin Cojocar
parent 229cf63a09
commit 399e835157
3 changed files with 7 additions and 7 deletions

View File

@ -49,7 +49,7 @@ type rangeResult struct {
type branchResults struct {
minValue *int
maxValue *uint
explixitPositiveVals []uint
explicitPositiveVals []uint
explicitNegativeVals []int
convertFound bool
}
@ -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
@ -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:

View File

@ -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

View File

@ -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)