lttng: fix: out-of-bounds copy of original 'view' command arguments
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 14 Sep 2019 20:49:07 +0000 (16:49 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Sep 2019 19:31:49 +0000 (15:31 -0400)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/view.c

index 0325e505c505fab3dab2bc666fa7caec40822aa4..237ea4a15675d775150ef17d3147124398fb11de 100644 (file)
@@ -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";
This page took 0.026137 seconds and 4 git commands to generate.