From: Jérémie Galarneau Date: Sat, 14 Sep 2019 20:49:07 +0000 (-0400) Subject: lttng: fix: out-of-bounds copy of original 'view' command arguments X-Git-Tag: v2.12.0-rc1~379 X-Git-Url: http://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=fc1465822a1075d98160bb74ae8e974ac8c010a8 lttng: fix: out-of-bounds copy of original 'view' command arguments 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 --- 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";