diff --git a/Binary_data_in_Exif_Comment.jpg b/Binary_data_in_Exif_Comment.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4716a46648bc381fe0560bf1d19099d4c5621190 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 53e4f5be4e09b25f40324ba0cbf1f7285a1a9e50..e17da8643130e9d25387aea7ac144c13ad059884 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)