Fix: unchecked access to pids array
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 29 Aug 2018 21:25:04 +0000 (17:25 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 7 Sep 2018 16:21:03 +0000 (12:21 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/lib/lttng-ctl/lttng-ctl.c

index f6fadcb6adaadb16ccb21cb2fb0ad752581b1050..2d84aad90238904440f377eae0d945f59c0ecb20 100644 (file)
@@ -2575,6 +2575,9 @@ int lttng_list_tracker_pids(struct lttng_handle *handle,
                return ret;
        }
        nr_pids = ret / sizeof(int32_t);
+       if (nr_pids > 0 && !pids) {
+               return -LTTNG_ERR_UNK;
+       }
        if (nr_pids == 1 && pids[0] == -1) {
                free(pids);
                pids = NULL;
This page took 0.026947 seconds and 5 git commands to generate.