Fix (CWE-118): Implicit memory aliasing in for loop.
This commit is contained in:
parent
e651a7495f
commit
9f49a689fd
3 changed files with 6 additions and 6 deletions
|
@ -473,7 +473,7 @@ func buildExerciceFlags(i Importer, exercice *fic.Exercice, exceptions *CheckExc
|
|||
|
||||
// Ensure flag ID is unique
|
||||
for _, ok := flags[flag.Id]; ok; _, ok = flags[flag.Id] {
|
||||
errs = append(errs, NewFlagError(exercice, &flag, nline+1, fmt.Errorf("identifier already used (%d), using a random one.", flag.Id)))
|
||||
errs = append(errs, NewFlagError(exercice, ¶ms.Flags[nline], nline+1, fmt.Errorf("identifier already used (%d), using a random one.", flag.Id)))
|
||||
flag.Id = rand.Int63()
|
||||
}
|
||||
|
||||
|
@ -491,7 +491,7 @@ func buildExerciceFlags(i Importer, exercice *fic.Exercice, exceptions *CheckExc
|
|||
// Read dependency to flag
|
||||
for _, nf := range flag.NeedFlag {
|
||||
if len(nf.Theme) > 0 {
|
||||
errs = append(errs, NewFlagError(exercice, &flag, nline+1, fmt.Errorf("dependancy on another scenario is not implemented yet.")))
|
||||
errs = append(errs, NewFlagError(exercice, ¶ms.Flags[nline], nline+1, fmt.Errorf("dependancy on another scenario is not implemented yet.")))
|
||||
}
|
||||
newFlag.FlagsDeps = append(newFlag.FlagsDeps, nf.Id)
|
||||
}
|
||||
|
|
Reference in a new issue