aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2026-08-01 23:43:38 +0200
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2026-08-01 23:43:38 +0200
commitff9ea762b7d6a6af3c4801e70d71d40c6d87750a (patch)
tree424b668c337fbc2ac545d8dd54f1be381827f48d
parentbbbe4cdbc9ba9d43582c9420303d2aab977673a4 (diff)
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.
-rw-r--r--src/interface-curses/interface.c4
1 files 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')) {