From 92c18757c85c95a77d0d0305ce80ac788e9185ca Mon Sep 17 00:00:00 2001 From: Jonathan Kamens Date: Sat, 22 Sep 2018 07:50:53 -0400 Subject: [PATCH] trusteddomainproject/OpenDMARC#26 --- opendmarc/opendmarc-arcares.c | 2 ++ opendmarc/opendmarc-arcseal.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/opendmarc/opendmarc-arcares.c b/opendmarc/opendmarc-arcares.c index 8e9ae71b..0269c87f 100644 --- a/opendmarc/opendmarc-arcares.c +++ b/opendmarc/opendmarc-arcares.c @@ -321,6 +321,8 @@ opendmarc_arcares_arc_parse (u_char *hdr_arc, struct arcares_arc_field *arc) leading_space_len = strspn(token, " \n"); token_ptr = token + leading_space_len; + if (*token_ptr == '\0') + return 0; tag_label = strsep(&token_ptr, "="); tag_value = opendmarc_arcares_strip_whitespace(token_ptr); tag_code = opendmarc_arcares_convert(aar_arc_tags, tag_label); diff --git a/opendmarc/opendmarc-arcseal.c b/opendmarc/opendmarc-arcseal.c index 88aab57d..d7d85cc6 100644 --- a/opendmarc/opendmarc-arcseal.c +++ b/opendmarc/opendmarc-arcseal.c @@ -220,6 +220,8 @@ opendmarc_arcseal_parse(u_char *hdr, struct arcseal *as) leading_space_len = strspn(token, " \n"); token_ptr = token + leading_space_len; + if (*token_ptr == '\0') + return 0; tag_label = strsep(&token_ptr, "="); tag_value = opendmarc_arcseal_strip_whitespace(token_ptr);