projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: Mismatching return type in ust_app_ht_alloc() stub
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
cmd.c
diff --git
a/src/bin/lttng-sessiond/cmd.c
b/src/bin/lttng-sessiond/cmd.c
index c1e33693f913076d58d8dba938975be23e10d4bc..58506b2b225e5e0e306d9fad8682013e52a0723d 100644
(file)
--- a/
src/bin/lttng-sessiond/cmd.c
+++ b/
src/bin/lttng-sessiond/cmd.c
@@
-18,6
+18,7
@@
#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <assert.h>
#define _GNU_SOURCE
#define _LGPL_SOURCE
#include <assert.h>
+#include <string.h>
#include <inttypes.h>
#include <urcu/list.h>
#include <urcu/uatomic.h>
#include <inttypes.h>
#include <urcu/list.h>
#include <urcu/uatomic.h>
@@
-939,11
+940,21
@@
int cmd_enable_channel(struct ltt_session *session,
int ret;
struct ltt_ust_session *usess = session->ust_session;
struct lttng_ht *chan_ht;
int ret;
struct ltt_ust_session *usess = session->ust_session;
struct lttng_ht *chan_ht;
+ size_t len;
assert(session);
assert(attr);
assert(domain);
assert(session);
assert(attr);
assert(domain);
+ len = strnlen(attr->name, sizeof(attr->name));
+
+ /* Validate channel name */
+ if (attr->name[0] == '.' ||
+ memchr(attr->name, '/', len) != NULL) {
+ ret = LTTNG_ERR_INVALID_CHANNEL_NAME;
+ goto end;
+ }
+
DBG("Enabling channel %s for session %s", attr->name, session->name);
rcu_read_lock();
DBG("Enabling channel %s for session %s", attr->name, session->name);
rcu_read_lock();
@@
-1024,6
+1035,7
@@
int cmd_enable_channel(struct ltt_session *session,
error:
rcu_read_unlock();
error:
rcu_read_unlock();
+end:
return ret;
}
return ret;
}
@@
-2967,11
+2979,13
@@
static int record_kernel_snapshot(struct ltt_kernel_session *ksess,
}
ret = LTTNG_OK;
}
ret = LTTNG_OK;
+ goto end;
error_snapshot:
/* Clean up copied sockets so this output can use some other later on. */
consumer_destroy_output_sockets(output->consumer);
error:
error_snapshot:
/* Clean up copied sockets so this output can use some other later on. */
consumer_destroy_output_sockets(output->consumer);
error:
+end:
return ret;
}
return ret;
}
This page took
0.026693 seconds
and
4
git commands to generate.