[diffoscope] 01/01: Don't crash on malformed md5sums files. (Closes: #877473)

Chris Lamb chris at chris-lamb.co.uk
Tue Oct 3 18:26:54 UTC 2017


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository diffoscope.

commit 70cb725deb12a2eddc4613b5e3af69ed13434bf7
Author: Chris Lamb <lamby at debian.org>
Date:   Tue Oct 3 19:25:44 2017 +0100

    Don't crash on malformed md5sums files. (Closes: #877473)
---
 diffoscope/feeders.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/diffoscope/feeders.py b/diffoscope/feeders.py
index 5627314..c8a84af 100644
--- a/diffoscope/feeders.py
+++ b/diffoscope/feeders.py
@@ -55,7 +55,8 @@ def from_raw_reader(in_file, filter=lambda buf: buf):
                 # python buffering; force a flush here to avoid this,
                 # see https://bugs.debian.org/870049
                 out_file.flush()
-            end_nl = buf[-1] == '\n'
+            if buf:
+                end_nl = buf[-1] == '\n'
 
         if h is not None and line_count >= max_lines:
             out_file.write("[ Too much input for diff (SHA1: {}) ]\n".format(

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git



More information about the Reproducible-commits mailing list