From 268055804edb9b6257407d001968f212596148d8 Mon Sep 17 00:00:00 2001 From: Evan Su <48808396+HACKERALERT@users.noreply.github.com> Date: Fri, 18 Apr 2025 17:03:09 -0400 Subject: [PATCH] two os.Removes conflict, allow them to err deniability and split --- src/Picocrypt.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Picocrypt.go b/src/Picocrypt.go index 4872bd5..79e5049 100644 --- a/src/Picocrypt.go +++ b/src/Picocrypt.go @@ -2510,9 +2510,7 @@ func work() { panic(err) } if deniability { - if err := os.Remove(strings.TrimSuffix(inputFile, ".tmp")); err != nil { - panic(err) - } + os.Remove(strings.TrimSuffix(inputFile, ".tmp")) } } @@ -2558,9 +2556,7 @@ func work() { } } if mode == "decrypt" && deniability { - if err := os.Remove(inputFile); err != nil { - panic(err) - } + os.Remove(inputFile) } if mode == "decrypt" && !kept && autoUnzip { @@ -2710,7 +2706,7 @@ func rsDecode(rs *infectious.FEC, data []byte) ([]byte, error) { } tmp := make([]infectious.Share, rs.Total()) - for i := 0; i < rs.Total(); i++ { + for i := range rs.Total() { tmp[i].Number = i tmp[i].Data = append(tmp[i].Data, data[i]) } @@ -2757,7 +2753,7 @@ func genPassword() string { chars += "-=_+!@#$^&()?<>" } tmp := make([]byte, passgenLength) - for i := 0; i < int(passgenLength); i++ { + for i := range int(passgenLength) { j, _ := rand.Int(rand.Reader, big.NewInt(int64(len(chars)))) tmp[i] = chars[j.Int64()] }