Fix: possible null dereference on communication error
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 29 Aug 2018 21:06:48 +0000 (17:06 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 30 Aug 2018 16:35:13 +0000 (12:35 -0400)
lttng_ctl_ask_sessiond_fds_varlen() can return a positive
error code and NULL buffers if the sessiond uses a command
return code that is already negative.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/lib/lttng-ctl/lttng-ctl.c

index eff08df80ee937c46177765bf518f739a1d5d2a7..f503fd1cbf42a25660a990d869c7adeb467cc823 100644 (file)
@@ -1959,6 +1959,11 @@ int lttng_list_events(struct lttng_handle *handle,
                goto end;
        }
 
+       if (!cmd_header) {
+               ret = -LTTNG_ERR_UNK;
+               goto end;
+       }
+
        /* Set number of events and free command header */
        nb_events = cmd_header->nb_events;
        if (nb_events > INT_MAX) {
This page took 0.02663 seconds and 4 git commands to generate.