gboolean encrypted = FALSE, is_shingle = FALSE;
struct rspamd_fuzzy_cmd *cmd = NULL;
const struct rspamd_shingle *shingle = NULL;
+ struct rspamd_shingle sgl_cpy;
switch (session->cmd_type) {
case CMD_NORMAL:
break;
case CMD_SHINGLE:
cmd = &session->cmd.shingle.basic;
- shingle = &session->cmd.shingle.sgl;
+ memcpy (&sgl_cpy, &session->cmd.shingle.sgl, sizeof (sgl_cpy));
+ shingle = &sgl_cpy;
is_shingle = TRUE;
break;
case CMD_ENCRYPTED_NORMAL:
break;
case CMD_ENCRYPTED_SHINGLE:
cmd = &session->cmd.enc_shingle.cmd.basic;
- shingle = &session->cmd.enc_shingle.cmd.sgl;
+ memcpy (&sgl_cpy, &session->cmd.enc_shingle.cmd.sgl, sizeof (sgl_cpy));
+ shingle = &sgl_cpy;
encrypted = TRUE;
is_shingle = TRUE;
break;