ARC: Fix verification to do AS checks in reverse order
[exim.git] / src / src / arc.c
index 466c1399079d6e1e15c72459ff3b50367d388a5d..64362e751fc7ee636a3bab449986749e10469030 100644 (file)
@@ -984,16 +984,13 @@ return NULL;
 static const uschar *
 arc_verify_seals(arc_ctx * ctx)
 {
-arc_set * as = ctx->arcset_chain;
+arc_set * as = ctx->arcset_chain_last;
 
 if (!as)
   return US"none";
 
-while (as)
-  {
-  if (arc_seal_verify(ctx, as)) return US"fail";
-  as = as->next;
-  }
+for ( ; as; as = as->prev) if (arc_seal_verify(ctx, as)) return US"fail";
+
 DEBUG(D_acl) debug_printf("ARC: AS vfy overall pass\n");
 return NULL;
 }