From 715e1bd6a996cb608b4e740ff5d8e6ca876fa16c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 9 Feb 2017 16:24:29 +0000 Subject: [PATCH] [Minor] Fix lengths when parsing email addresses --- src/libmime/email_addr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libmime/email_addr.c b/src/libmime/email_addr.c index 4ecfaec76..d534be53f 100644 --- a/src/libmime/email_addr.c +++ b/src/libmime/email_addr.c @@ -355,7 +355,7 @@ rspamd_email_address_from_mime (rspamd_mempool_t *pool, if (seen_at) { /* The whole email is likely address */ - rspamd_smtp_addr_parse (c, p - c + 1, &addr); + rspamd_smtp_addr_parse (c, p - c, &addr); if (addr.flags & RSPAMD_EMAIL_ADDR_VALID) { rspamd_email_address_add (pool, res, &addr, ns); @@ -363,7 +363,7 @@ rspamd_email_address_from_mime (rspamd_mempool_t *pool, else { /* Try heuristic */ if (rspamd_email_address_parse_heuristic (c, - p - c + 1, &addr)) { + p - c, &addr)) { rspamd_email_address_add (pool, res, &addr, ns); } else { @@ -373,7 +373,7 @@ rspamd_email_address_from_mime (rspamd_mempool_t *pool, } else { /* No @ seen */ - g_string_append_len (ns, c, p - c + 1); + g_string_append_len (ns, c, p - c); rspamd_email_address_add (pool, res, NULL, ns); } } -- 2.39.5