From bde055158a009d2ab9feb1313aafb1065c6f6127 Mon Sep 17 00:00:00 2001
From: "plvines (corpora)" <paul.vines@baesystems.com>
Date: Wed, 26 Feb 2020 19:15:13 +0000
Subject: [PATCH] Fixed hdr junk violation being overaggressive

---
 pdf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pdf.c b/pdf.c
index fefa03b..7ee7759 100644
--- a/pdf.c
+++ b/pdf.c
@@ -1147,8 +1147,9 @@ init_parser(struct Env *aux)
 
 	H_RULE(xr_td,	SEQ(xrefs, KW("trailer"), ws, dict));
 
-	H_RULE(hdr_junk,    VIOL(h_many1(h_butnot(h_ch_range(0, 255), SEQ(npair, wel, KW("obj")))),
-				 "Uncommented junk after header (severity=1)"));
+	H_RULE(hdr_junk,    CHX(comment,
+                                VIOL(h_many1(h_butnot(h_ch_range(0, 255), SEQ(npair, wel, KW("obj")))),
+                                              "Uncommented junk after header (severity=1)")));
 	H_RULE(tail,	SEQ(body, CHX(SEQ(h_optional(xr_td), startxr),
 				      VIOL(SEQ(xr_td, OPT(SEQ(nl, KW("startxref"), nl, lws, nat, nl)),
 					       OPT(nl), OPT(LIT("%%EOF")), OPT(nl)),
-- 
GitLab