From 1c8579d0ee4684a1e60f8c92abaf8d2c6df2bd36 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Mon, 23 Nov 2020 13:48:55 -0500 Subject: Do not parse email if no x-patch-sig Don't attempt to parse the email if we don't find the x-patch-sig header. Signed-off-by: Konstantin Ryabitsev --- b4/attest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/b4/attest.py b/b4/attest.py index 5e3d384..8ae939e 100644 --- a/b4/attest.py +++ b/b4/attest.py @@ -110,6 +110,10 @@ def mutt_filter() -> None: logger.error('Error: Mutt mode expects a message on stdin') sys.exit(1) inb = sys.stdin.buffer.read() + # Quick exit if we don't find x-patch-sig + if inb.find(b'X-Patch-Sig:') < 0: + sys.stdout.buffer.write(inb) + return try: msg = email.message_from_bytes(inb) if msg.get('x-patch-sig'): -- cgit v1.2.3