From fc1465822a1075d98160bb74ae8e974ac8c010a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Sat, 14 Sep 2019 16:49:07 -0400 Subject: [PATCH] lttng: fix: out-of-bounds copy of original 'view' command arguments MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit A mix-up between 'size' and 'opts_len' can cause the copy of the original arguments passed to the 'view' command can result in out-of-bounds accesses. Signed-off-by: Jérémie Galarneau --- src/bin/lttng/commands/view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng/commands/view.c b/src/bin/lttng/commands/view.c index 0325e505c..237ea4a15 100644 --- a/src/bin/lttng/commands/view.c +++ b/src/bin/lttng/commands/view.c @@ -188,7 +188,7 @@ static char **alloc_argv_from_local_opts(const char **opts, size_t opts_len, goto error; } - memcpy(argv, opts, size); + memcpy(argv, opts, opts_len); if (session_live_mode) { argv[opts_len] = "-i"; -- 2.34.1