ARC: harden versus badly-formatted AMS line
[exim.git] / src / src / pdkim / pdkim.c
index 9fa38b3e719acda703967dd3876b7c487d49a3a3..7fcfbc76a46aa4c46d2ee3080080be898e0a3609 100644 (file)
@@ -2029,6 +2029,8 @@ pdkim_set_bodyhash(pdkim_ctx * ctx, int hashtype, int canon_method,
 {
 pdkim_bodyhash * b;
 
+if (hashtype == -1 || canon_method == -1) return NULL;
+
 for (b = ctx->bodyhash; b; b = b->next)
   if (  hashtype == b->hashtype
      && canon_method == b->canon_method