From: Mathieu Desnoyers Date: Mon, 1 Oct 2012 23:19:29 +0000 (-0400) Subject: Fix: off-by-one in comm proto between lttng-ctl and sessiond X-Git-Tag: v2.1.0-rc5~40 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=db8870edf473e2a2f69e488375d32405ea324017;p=lttng-tools.git Fix: off-by-one in comm proto between lttng-ctl and sessiond Mostly affects setting a filter on an event with large event name. This fix breaks the ABI between lttng-ctl and lttng-sessiond, both should be updated together, and sessiond must be restarted. Fixes #357 Signed-off-by: Christian Babeux Signed-off-by: Mathieu Desnoyers --- diff --git a/src/common/sessiond-comm/sessiond-comm.h b/src/common/sessiond-comm/sessiond-comm.h index 6d796efe4..753e84234 100644 --- a/src/common/sessiond-comm/sessiond-comm.h +++ b/src/common/sessiond-comm/sessiond-comm.h @@ -167,12 +167,12 @@ struct lttcomm_session_msg { struct lttng_domain domain; union { struct { - char channel_name[NAME_MAX]; + char channel_name[LTTNG_SYMBOL_NAME_LEN]; char name[NAME_MAX]; } disable; /* Event data */ struct { - char channel_name[NAME_MAX]; + char channel_name[LTTNG_SYMBOL_NAME_LEN]; struct lttng_event event; } enable; /* Create channel */ @@ -181,8 +181,8 @@ struct lttcomm_session_msg { } channel; /* Context */ struct { - char channel_name[NAME_MAX]; - char event_name[NAME_MAX]; + char channel_name[LTTNG_SYMBOL_NAME_LEN]; + char event_name[LTTNG_SYMBOL_NAME_LEN]; struct lttng_event_context ctx; } context; /* Use by register_consumer */ @@ -191,7 +191,7 @@ struct lttcomm_session_msg { } reg; /* List */ struct { - char channel_name[NAME_MAX]; + char channel_name[LTTNG_SYMBOL_NAME_LEN]; } list; struct lttng_calibrate calibrate; /* Used by the set_consumer_url and used by create_session also call */ @@ -200,8 +200,8 @@ struct lttcomm_session_msg { uint32_t size; } uri; struct { - char channel_name[NAME_MAX]; - char event_name[NAME_MAX]; + char channel_name[LTTNG_SYMBOL_NAME_LEN]; + char event_name[LTTNG_SYMBOL_NAME_LEN]; /* Length of following bytecode */ uint32_t bytecode_len; } filter;