struct fuzzy_cmd_io {
guint32 tag;
guint32 flags;
- struct rspamd_fuzzy_cmd *cmd;
+ struct rspamd_fuzzy_cmd cmd;
struct iovec io;
};
io = rspamd_mempool_alloc (pool, sizeof (*io));
io->flags = 0;
io->tag = cmd->tag;
- io->cmd = cmd;
+ memcpy (&io->cmd, cmd, sizeof (io->cmd));
if (rule->peer_key) {
fuzzy_encrypt_cmd (rule, &enccmd->hdr, (guchar *)cmd, sizeof (*cmd));
io = rspamd_mempool_alloc (pool, sizeof (*io));
io->flags = 0;
io->tag = cmd->tag;
- io->cmd = cmd;
+ memcpy (&io->cmd, cmd, sizeof (io->cmd));
if (rule->peer_key) {
fuzzy_encrypt_cmd (rule, &enccmd->hdr, (guchar *)cmd, sizeof (*cmd));
io = rspamd_mempool_alloc (pool, sizeof (*io));
io->tag = shcmd->basic.tag;
io->flags = 0;
- io->cmd = &shcmd->basic;
+ memcpy (&io->cmd, &shcmd->basic, sizeof (io->cmd));
if (rule->peer_key) {
/* Encrypt data */
io = rspamd_mempool_alloc (pool, sizeof (*io));
io->flags = 0;
io->tag = cmd->tag;
- io->cmd = cmd;
+ memcpy (&io->cmd, cmd, sizeof (io->cmd));
if (rule->peer_key) {
g_assert (enccmd != NULL);
io->flags |= FUZZY_CMD_FLAG_REPLIED;
if (pcmd) {
- *pcmd = io->cmd;
+ *pcmd = &io->cmd;
}
return rep;