diff --git a/opendmarc/opendmarc-arcseal.c b/opendmarc/opendmarc-arcseal.c index 73eebb7..9264eee 100644 --- a/opendmarc/opendmarc-arcseal.c +++ b/opendmarc/opendmarc-arcseal.c @@ -29,7 +29,7 @@ #include "opendmarc.h" #define OPENDMARC_ARCSEAL_MAX_FIELD_NAME_LEN 255 -#define OPENDMARC_ARCSEAL_MAX_TOKEN_LEN 512 +#define OPENDMARC_ARCSEAL_MAX_TOKEN_LEN 768 /* tables */ struct opendmarc_arcseal_lookup @@ -167,7 +167,12 @@ opendmarc_arcseal_parse(u_char *hdr, struct arcseal *as) if (*token_ptr == '\0') return 0; tag_label = strsep(&token_ptr, "="); + if (tag_label == NULL) + return 0; + tag_value = opendmarc_arcseal_strip_whitespace(token_ptr); + if (tag_value == NULL) + return 0; tag_code = opendmarc_arcseal_convert(as_tags, tag_label); diff --git a/opendmarc/opendmarc-arcseal.h b/opendmarc/opendmarc-arcseal.h index 4eb0927..6e11a06 100644 --- a/opendmarc/opendmarc-arcseal.h +++ b/opendmarc/opendmarc-arcseal.h @@ -32,7 +32,7 @@ /* max header tag value length (short) */ #define OPENDMARC_ARCSEAL_MAX_SHORT_VALUE_LEN 256 /* max header tag value length (long) */ -#define OPENDMARC_ARCSEAL_MAX_LONG_VALUE_LEN 512 +#define OPENDMARC_ARCSEAL_MAX_LONG_VALUE_LEN 768 /* names and field labels */ #define OPENDMARC_ARCSEAL_HDRNAME "ARC-Seal"