diff --git a/opendmarc/opendmarc-ar.c b/opendmarc/opendmarc-ar.c index c76a0ff..7e94759 100644 --- a/opendmarc/opendmarc-ar.c +++ b/opendmarc/opendmarc-ar.c @@ -422,7 +422,7 @@ ares_parse(u_char *hdr, struct authres *ar) if (tokens[c][0] == ';') { prevstate = state; - state = 3; + state = 14; } else if (isascii(tokens[c][0]) && isdigit(tokens[c][0])) @@ -447,10 +447,20 @@ ares_parse(u_char *hdr, struct authres *ar) return -1; prevstate = state; - state = 3; + state = 14; break; + case 14: /* method or "none" */ + if (strcasecmp((char *) tokens[c], "none") == 0) + { + prevstate = state; + state = 15; + continue; + } + + /* FALLTHROUGH */ + case 3: /* method */ n++; r = 0; @@ -619,6 +629,10 @@ ares_parse(u_char *hdr, struct authres *ar) } break; + + case 15: /* terminal state after no-result */ + /* any token should not appear */ + return -1; } }