mirror of
https://github.com/Icinga/icingadb.git
synced 2026-02-18 18:18:00 -05:00
icingadb-migrate: Address golangci-lint gosec reports
The latest gosec release brought some new false positives reported in the icingadb-migrate command.
This commit is contained in:
parent
d4e399181e
commit
235eca9217
2 changed files with 3 additions and 1 deletions
|
|
@ -289,7 +289,7 @@ func convertDowntimeRows(
|
|||
// with factor 1,000 should not overflow anything. In theory, at least. To make sure, invalid values are capped.
|
||||
var flexibleDuration uint64
|
||||
if durationSec := row.Duration; durationSec >= 0 && durationSec < math.MaxUint64/1_000 {
|
||||
flexibleDuration = uint64(durationSec) * 1_000
|
||||
flexibleDuration = uint64(durationSec) * 1_000 // #nosec G115 -- int64 -> uint64 cannot overflow, check above
|
||||
}
|
||||
|
||||
downtimeHistory = append(downtimeHistory, &history.DowntimeHistory{
|
||||
|
|
|
|||
|
|
@ -129,6 +129,8 @@ func parseConfig(f *Flags) (_ *Config, exit int) {
|
|||
}
|
||||
|
||||
if err := yaml.NewDecoder(cf, yaml.DisallowUnknownField()).Decode(c); err != nil {
|
||||
// #nosec G705 -- this error message should do no harm in the output, being printed to stderr
|
||||
// on a terminal and not used as an HTML page or the like
|
||||
_, _ = fmt.Fprintf(os.Stderr, "can't parse config file: %s\n", err.Error())
|
||||
return nil, 2
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue