From: Jérémie Galarneau Date: Wed, 29 Aug 2018 21:25:04 +0000 (-0400) Subject: Fix: unchecked access to pids array X-Git-Tag: v2.9.11~35 X-Git-Url: http://git.liburcu.org/?p=lttng-tools.git;a=commitdiff_plain;h=19cc51bb4636229e3bd6b9de1156d84bf7664067 Fix: unchecked access to pids array Signed-off-by: Jérémie Galarneau --- diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 8afa6a820..870813901 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -2355,6 +2355,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;