Skip to content

Commit fe2288d

Browse files
committed
Merge pull request trusteddomainproject#205 from futatuki/parse-ar-no-result
2 parents 3889fa4 + 48fda00 commit fe2288d

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

opendkim/opendkim-ar.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ ares_parse(u_char *hdr, struct authres *ar)
454454
if (tokens[c][0] == ';')
455455
{
456456
prevstate = state;
457-
state = 3;
457+
state = 14;
458458
}
459459
else if (isascii(tokens[c][0]) &&
460460
isdigit(tokens[c][0]))
@@ -479,10 +479,20 @@ ares_parse(u_char *hdr, struct authres *ar)
479479
return -1;
480480

481481
prevstate = state;
482-
state = 3;
482+
state = 14;
483483

484484
break;
485485

486+
case 14: /* method or "none" */
487+
if (strcasecmp((char *) tokens[c], "none") == 0)
488+
{
489+
prevstate = state;
490+
state = 15;
491+
continue;
492+
}
493+
494+
/* FALLTHROUGH */
495+
486496
case 3: /* method */
487497
if (n == 0 || !ares_dedup(ar, n))
488498
n++;
@@ -651,6 +661,10 @@ ares_parse(u_char *hdr, struct authres *ar)
651661
state = 9;
652662

653663
break;
664+
665+
case 15: /* terminal state after no-result */
666+
/* no token should not appear */
667+
return -1;
654668
}
655669
}
656670

0 commit comments

Comments
 (0)