fix: database/sql.Scanner should not retain references (#6380)

This commit is contained in:
Nuno Cruces
2023-06-07 08:02:07 +01:00
committed by GitHub
parent 661781a3d7
commit 7157b7e375
+2 -2
View File
@@ -170,10 +170,10 @@ func (data *EncryptedData) Scan(value interface{}) error {
return errors.New("Too short")
}
*data = b[3:]
*data = append((*data)[0:], b[3:]...)
return nil
} else if s, ok := value.(string); ok {
*data = []byte(s)[3:]
*data = []byte(s[3:])
return nil
}