From e8e7b41fef40032398d35650489a717108ac70de Mon Sep 17 00:00:00 2001 From: "A. Schulze" Date: Sat, 14 Jan 2023 12:47:32 +0100 Subject: [PATCH 1/2] opendmarc-arcseal.patch.txt aus https://github.com/trusteddomainproject/OpenDMARC/issues/183 --- opendmarc/opendmarc-arcseal.c | 7 ++++++- opendmarc/opendmarc-arcseal.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/opendmarc/opendmarc-arcseal.c b/opendmarc/opendmarc-arcseal.c index 73eebb74..66fc62a7 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 (token_ptr == 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 4eb09272..6e11a063 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" From 98277442a59440cd46c9fc6055cbb67ce4ce468f Mon Sep 17 00:00:00 2001 From: "A. Schulze" Date: Sun, 4 May 2025 17:41:26 +0200 Subject: [PATCH 2/2] no known issue so far, but checking tag_label make much more sense --- opendmarc/opendmarc-arcseal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opendmarc/opendmarc-arcseal.c b/opendmarc/opendmarc-arcseal.c index 66fc62a7..9264eee5 100644 --- a/opendmarc/opendmarc-arcseal.c +++ b/opendmarc/opendmarc-arcseal.c @@ -167,7 +167,7 @@ opendmarc_arcseal_parse(u_char *hdr, struct arcseal *as) if (*token_ptr == '\0') return 0; tag_label = strsep(&token_ptr, "="); - if (token_ptr == NULL) + if (tag_label == NULL) return 0; tag_value = opendmarc_arcseal_strip_whitespace(token_ptr);