diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-11-23 13:48:55 -0500 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-11-23 13:48:55 -0500 |
commit | 1c8579d0ee4684a1e60f8c92abaf8d2c6df2bd36 (patch) | |
tree | 77951d0c3057eb73c3e8a3f78a1e57fef8be7797 | |
parent | 957d6ac60bda29b80f012aeebf574a0d67d159cb (diff) | |
download | b4-1c8579d0ee4684a1e60f8c92abaf8d2c6df2bd36.tar.gz |
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 <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/attest.py | 4 |
1 files changed, 4 insertions, 0 deletions
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'): |