From c621504e25e32de71a05416621c028ea77f4ff5b Mon Sep 17 00:00:00 2001 From: Philipp Resch Date: Mon, 10 Jun 2024 11:08:50 +0200 Subject: [PATCH] gosec fixes for issue #9 --- backends/p_guerrilla_db_redis.go | 2 +- backends/util.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backends/p_guerrilla_db_redis.go b/backends/p_guerrilla_db_redis.go index 854933d..f559993 100644 --- a/backends/p_guerrilla_db_redis.go +++ b/backends/p_guerrilla_db_redis.go @@ -472,7 +472,7 @@ func GuerrillaDbRedis() Decorator { e.TLS) // give the values to a random query batcher var index int - err := binary.Read(rand.Reader, binary.LittleEndian, &index) + err = binary.Read(rand.Reader, binary.LittleEndian, &index) if err != nil { panic(err) } diff --git a/backends/util.go b/backends/util.go index 9b87173..b4bec05 100644 --- a/backends/util.go +++ b/backends/util.go @@ -3,7 +3,7 @@ package backends import ( "bytes" "compress/zlib" - "crypto/md5" + "crypto/md5" //#nosec G501 - Deprecated, kept for backwards compatibility "fmt" "io" "net/textproto" @@ -53,7 +53,7 @@ func ParseHeaders(mailData string) map[string]string { // - string: The hexadecimal representation of the MD5 hash. // Deprecated: use BLAKE128s128Hex instead func MD5Hex(stringArguments ...string) string { - h := md5.New() + h := md5.New() //#nosec G401 - Deprecated, kept for backwards compatibility var r *strings.Reader for i := 0; i < len(stringArguments); i++ { r = strings.NewReader(stringArguments[i])