More CodeQL fixes

This commit is contained in:
Kovid Goyal
2025-04-20 22:13:45 +05:30
parent 237bb35ee9
commit 341df0dccb
7 changed files with 20 additions and 22 deletions

View File

@@ -131,8 +131,8 @@ func Encrypt_cmd(cmd *utils.RemoteControlCmd, password string, other_pubkey []by
}
func Encrypt_data(data []byte, other_pubkey []byte, encryption_protocol string) (ans []byte, err error) {
d := make([]byte, 0, len(data)+32)
d = append(d, []byte(fmt.Sprintf("%s:", strconv.FormatInt(time.Now().UnixNano(), 10)))...)
d := make([]byte, 0, uint64(len(data))+32)
d = fmt.Appendf(d, "%s:", strconv.FormatInt(time.Now().UnixNano(), 10))
d = append(d, data...)
iv, tag, ciphertext, pubkey, err := encrypt(d, other_pubkey, encryption_protocol)
if err != nil {