diff --git a/Binary_data_in_Exif_Comment.jpg b/Binary_data_in_Exif_Comment.jpg new file mode 100644 index 0000000..4716a46 Binary files /dev/null and b/Binary_data_in_Exif_Comment.jpg differ diff --git a/tests/test_climat2.py b/tests/test_climat2.py index 53e4f5b..e17da86 100644 --- a/tests/test_climat2.py +++ b/tests/test_climat2.py @@ -174,3 +174,10 @@ class TestGetMeta(unittest.TestCase): self.assertIn(b'genre: Python', stdout) self.assertIn(b'i am a : various comment', stdout) self.assertIn(b'artist: jvoisin', stdout) + +class TestControlCharInjection(unittest.TestCase): + def test_jpg(self): + proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/control_chars.jpg'], + stdout=subprocess.PIPE) + stdout, _ = proc.communicate() + self.assertIn(b'Comment: GQ\n', stdout)