Truncate exclusion names to have a terminal '\0'
[lttng-tools.git] / src / lib / lttng-ctl / lttng-ctl.c
index 100732648e6e288ef57829d70bec346e2ad59b70..665aba57d7cb80f37656c670fe6d3760747eb7a0 100644 (file)
@@ -19,7 +19,6 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#define _GNU_SOURCE
 #define _LGPL_SOURCE
 #include <assert.h>
 #include <grp.h>
@@ -1000,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) {
This page took 0.025333 seconds and 4 git commands to generate.