From: Philippe Proulx Date: Wed, 26 Aug 2015 22:11:46 +0000 (-0400) Subject: Truncate exclusion names to have a terminal '\0' X-Git-Tag: v2.8.0-rc1~229 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0c82ac624169ec9ec062f395e55abfe992d0fd91;p=lttng-tools.git Truncate exclusion names to have a terminal '\0' Signed-off-by: Philippe Proulx 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 ae27e6b5b..665aba57d 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -999,7 +999,8 @@ int lttng_enable_event_with_exclusions(struct lttng_handle *handle, /* Put exclusion names first in the data */ while (exclusion_count--) { strncpy(varlen_data + LTTNG_SYMBOL_NAME_LEN * exclusion_count, - *(exclusion_list + exclusion_count), LTTNG_SYMBOL_NAME_LEN); + *(exclusion_list + exclusion_count), + LTTNG_SYMBOL_NAME_LEN - 1); } /* Add filter expression next */ if (lsm.u.enable.expression_len != 0) {