diff options
author | sfan5 <sfan5@live.de> | 2022-11-09 15:03:18 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2022-11-10 16:19:37 +0100 |
commit | 175e2500383ba29dfb6e40a86bdcbc3cf52d2c5d (patch) | |
tree | ee3b64cb19df579f9d8bcfeeb29a8410b7467773 /video/out/wayland_common.c | |
parent | 2e5d0d6e07b373445dfecc3bb59454d08d9439d5 (diff) | |
download | mpv-175e2500383ba29dfb6e40a86bdcbc3cf52d2c5d.tar.bz2 mpv-175e2500383ba29dfb6e40a86bdcbc3cf52d2c5d.tar.xz |
wayland, x11: fix possibly unsafe bstr usage
In practice this never led to any issues due to implementation
details of bstr_sanitize_utf8_latin1, but there's no guarantee that
a bstr is correctly null-terminated.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 51f68a46a6..7dfaff2459 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1684,7 +1684,7 @@ static int update_window_title(struct vo_wayland_state *wl, const char *title) /* The xdg-shell protocol requires that the title is UTF-8. */ void *tmp = talloc_new(NULL); struct bstr b_title = bstr_sanitize_utf8_latin1(tmp, bstr0(title)); - xdg_toplevel_set_title(wl->xdg_toplevel, b_title.start); + xdg_toplevel_set_title(wl->xdg_toplevel, bstrto0(tmp, b_title)); talloc_free(tmp); return VO_TRUE; } |