From 399e835157aa69a09b4a8d1c14f9afcc203621ae Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Sat, 30 Nov 2024 00:46:31 +0200 Subject: [PATCH] Fix typos in comments and fields --- analyzers/conversion_overflow.go | 8 ++++---- analyzers/hardcoded_nonce.go | 4 ++-- rules/fileperms.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/analyzers/conversion_overflow.go b/analyzers/conversion_overflow.go index d2de110..a3afde9 100644 --- a/analyzers/conversion_overflow.go +++ b/analyzers/conversion_overflow.go @@ -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: diff --git a/analyzers/hardcoded_nonce.go b/analyzers/hardcoded_nonce.go index a514af0..c9c5395 100644 --- a/analyzers/hardcoded_nonce.go +++ b/analyzers/hardcoded_nonce.go @@ -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 diff --git a/rules/fileperms.go b/rules/fileperms.go index eb1fa2e..bf2a959 100644 --- a/rules/fileperms.go +++ b/rules/fileperms.go @@ -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)