From 2e8269f7b53395c9c67a73756aa71b6baaff23aa Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 11 Apr 2013 14:04:17 -0400 Subject: [PATCH] Fix: validate buffer type for UST channel creation Fixes #499 Signed-off-by: David Goulet --- src/bin/lttng-sessiond/channel.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index 1621bc626..bb5b3d1de 100644 --- a/src/bin/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -282,6 +282,16 @@ int channel_ust_create(struct ltt_ust_session *usess, goto error; } + /* Validate buffer type. */ + switch (type) { + case LTTNG_BUFFER_PER_PID: + case LTTNG_BUFFER_PER_UID: + break; + default: + ret = LTTNG_ERR_BUFFER_NOT_SUPPORTED; + goto error; + } + /* Create UST channel */ uchan = trace_ust_create_channel(attr, usess->pathname); if (uchan == NULL) { -- 2.34.1