mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-20 23:44:59 +02:00
Graphics protocol: Only delete temp files if they have the string tty-graphics-protocol in their file paths.
This prevents deletion of arbitrary files in /tmp via the graphics protocol.
This commit is contained in:
@@ -360,7 +360,7 @@ class TestGraphics(BaseTest):
|
||||
self.ae(img['data'], random_data)
|
||||
|
||||
# Test loading from file
|
||||
f = tempfile.NamedTemporaryFile()
|
||||
f = tempfile.NamedTemporaryFile(prefix='tty-graphics-protocol-')
|
||||
f.write(random_data), f.flush()
|
||||
sl(f.name, s=24, v=32, t='f', expecting_data=random_data)
|
||||
self.assertTrue(os.path.exists(f.name))
|
||||
|
||||
Reference in New Issue
Block a user