summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2018-04-24 13:07:53 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2018-04-24 13:07:53 +0100
commitef262e3170d26e4203fbf259180a34b1c0228a32 (patch)
treef83a3e2c3a3dbb803472f0c2f608964ada524620
parent0d7bb78a322846918f2190c525adacb0cddeeb5b (diff)
ARC: limit verify chain to 50-deep
-rw-r--r--src/src/arc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/src/arc.c b/src/src/arc.c
index ddf73959c..53d06de67 100644
--- a/src/src/arc.c
+++ b/src/src/arc.c
@@ -382,7 +382,7 @@ static uschar *
arc_insert_hdr(arc_ctx * ctx, header_line * h, unsigned off, unsigned hoff,
BOOL instance_only)
{
-int i;
+unsigned i;
arc_set * as;
arc_line * al = store_get(sizeof(arc_line)), ** alp;
uschar * e;
@@ -395,6 +395,7 @@ if ((e = arc_parse_line(al, h, off, instance_only)))
return US"line parse";
}
if (!(i = arc_instance_from_hdr(al))) return US"instance find";
+if (i > 50) return US"overlarge instance number";
if (!(as = arc_find_set(ctx, i))) return US"set find";
if (*(alp = (arc_line **)(US as + hoff))) return US"dup hdr";