From ff9ea762b7d6a6af3c4801e70d71d40c6d87750a Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sat, 1 Aug 2026 23:43:38 +0200 Subject: curses: fixed theoretical memory corruption when using clipboard registers But I doubt that get_string() could in practice fail on the plain environment variable Q-Regs. So this was never triggered. --- src/interface-curses/interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c index f99f413..11441d2 100644 --- a/src/interface-curses/interface.c +++ b/src/interface-curses/interface.c @@ -1529,7 +1529,7 @@ teco_interface_set_clipboard(const gchar *name, const gchar *str, gsize str_len, return FALSE; } - g_auto(teco_string_t) command; + g_auto(teco_string_t) command = {NULL, 0}; if (!reg->vtable->get_string(reg, &command.data, &command.len, NULL, error)) return FALSE; if (teco_string_contains(command, '\0')) { @@ -1590,7 +1590,7 @@ teco_interface_get_clipboard(const gchar *name, gchar **str, gsize *len, GError return FALSE; } - g_auto(teco_string_t) command; + g_auto(teco_string_t) command = {NULL, 0}; if (!reg->vtable->get_string(reg, &command.data, &command.len, NULL, error)) return FALSE; if (teco_string_contains(command, '\0')) { -- cgit v1.2.3