diff options
-rw-r--r-- | src/client/rspamdclient.c | 7 | ||||
-rw-r--r-- | src/libserver/dkim.c | 8 | ||||
-rw-r--r-- | src/libutil/str_util.c | 8 |
3 files changed, 14 insertions, 9 deletions
diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c index e71d5d3e0..4691ce5ec 100644 --- a/src/client/rspamdclient.c +++ b/src/client/rspamdclient.c @@ -193,12 +193,12 @@ rspamd_client_finish_handler (struct rspamd_http_connection *conn, ucl_parser_free (parser); req->cb (c, msg, c->server_name->str, NULL, req->input, req->ud, err); g_error_free (err); - g_free (out); + g_free (zout.dst); return 0; } - g_free (out); + g_free (zout.dst); } else { err = g_error_new (RCLIENT_ERROR, 500, @@ -386,9 +386,12 @@ rspamd_client_command (struct rspamd_client_connection *conn, g_slice_free1 (sizeof (struct rspamd_client_request), req); g_string_free (input, TRUE); rspamd_fstring_free (body); + ZSTD_freeCCtx (zctx); return FALSE; } + + ZSTD_freeCCtx (zctx); } rspamd_http_message_set_body_from_fstring_steal (req->msg, body); diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index cc11e5074..2d968bd0f 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -1423,16 +1423,16 @@ rspamd_dkim_skip_empty_lines (const gchar *start, const gchar *end, break; case got_crlf: if (p > start + 2) { - if (*(p - 3) == '\r') { + if (*(p - 2) == '\r') { p -= 2; state = got_cr; } - else if (*(p - 3) == '\n') { + else if (*(p - 2) == '\n') { p -= 2; state = got_lf; } - else if (type == DKIM_CANON_RELAXED && (*(p - 3) == ' ' || - *(p - 3) == '\t')) { + else if (type == DKIM_CANON_RELAXED && (*(p - 2) == ' ' || + *(p - 2) == '\t')) { skip = 2; state = test_spaces; } diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c index 3ebf297fc..c12a9c562 100644 --- a/src/libutil/str_util.c +++ b/src/libutil/str_util.c @@ -1134,10 +1134,11 @@ rspamd_header_value_fold (const gchar *name, break; case fold_token: /* Here, we have token start at 'c' and token end at 'p' */ - g_assert (p > c); - if (fold_type == fold_after) { - g_string_append_len (res, c, p - c); + + if (p > c) { + g_string_append_len (res, c, p - c); + } switch (how) { case RSPAMD_TASK_NEWLINES_LF: @@ -1160,6 +1161,7 @@ rspamd_header_value_fold (const gchar *name, cur_len = 0; } else { + g_assert (p > c); /* Skip space if needed */ if (g_ascii_isspace (*c) && p > c) { c ++; |