mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 18:22:09 +02:00
Graphics protocol: Dont return filename in the error message when opening file fails, since filenames can contain control characters
Fixes #3128
This commit is contained in:
@@ -26,6 +26,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
|||||||
- Add an option, :opt:`detect_urls` to control whether kitty will detect URLs
|
- Add an option, :opt:`detect_urls` to control whether kitty will detect URLs
|
||||||
when the mouse moves over them (:pull:`3118`)
|
when the mouse moves over them (:pull:`3118`)
|
||||||
|
|
||||||
|
- Graphics protocol: Dont return filename in the error message when opening file
|
||||||
|
fails, since filenames can contain control characters (:iss:`3128`)
|
||||||
|
|
||||||
|
|
||||||
0.19.2 [2020-11-13]
|
0.19.2 [2020-11-13]
|
||||||
-------------------
|
-------------------
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ handle_add_command(GraphicsManager *self, const GraphicsCommand *g, const uint8_
|
|||||||
snprintf(fname, sizeof(fname)/sizeof(fname[0]), "%.*s", (int)g->payload_sz, payload);
|
snprintf(fname, sizeof(fname)/sizeof(fname[0]), "%.*s", (int)g->payload_sz, payload);
|
||||||
if (tt == 's') fd = shm_open(fname, O_RDONLY, 0);
|
if (tt == 's') fd = shm_open(fname, O_RDONLY, 0);
|
||||||
else fd = open(fname, O_CLOEXEC | O_RDONLY);
|
else fd = open(fname, O_CLOEXEC | O_RDONLY);
|
||||||
if (fd == -1) ABRT(EBADF, "Failed to open file %s for graphics transmission with error: [%d] %s", fname, errno, strerror(errno));
|
if (fd == -1) ABRT(EBADF, "Failed to open file for graphics transmission with error: [%d] %s", errno, strerror(errno));
|
||||||
img->data_loaded = mmap_img_file(self, img, fd, g->data_sz, g->data_offset);
|
img->data_loaded = mmap_img_file(self, img, fd, g->data_sz, g->data_offset);
|
||||||
safe_close(fd, __FILE__, __LINE__);
|
safe_close(fd, __FILE__, __LINE__);
|
||||||
if (tt == 't') {
|
if (tt == 't') {
|
||||||
|
|||||||
Reference in New Issue
Block a user