Fix: sessiond: incorrect use of exclusions array leads to crash
[lttng-tools.git] / src / lib / lttng-ctl / lttng-ctl.cpp
index b9311a07ef2051bfeb6243e071f381aef3f90379..03ed2aa10a4459891018fe038b7a8cbdbaf50c75 100644 (file)
 #include <string.h>
 #include <unistd.h>
 
-#define COPY_DOMAIN_PACKED(dst, src)                             \
-       do {                                                     \
-               struct lttng_domain _tmp_domain;                 \
-                                                                 \
-               lttng_ctl_copy_lttng_domain(&_tmp_domain, &src); \
-               dst = _tmp_domain;                               \
+#define COPY_DOMAIN_PACKED(dst, src)                               \
+       do {                                                       \
+               struct lttng_domain _tmp_domain;                   \
+                                                                   \
+               lttng_ctl_copy_lttng_domain(&_tmp_domain, &(src)); \
+               (dst) = _tmp_domain;                               \
        } while (0)
 
 /* Socket to session daemon for communication */
@@ -1180,7 +1180,7 @@ int lttng_enable_event_with_exclusions(struct lttng_handle *handle,
 serialize:
        ret = lttng_event_serialize(ev,
                                    exclusion_count,
-                                   exclusion_list,
+                                   const_cast<const char **>(exclusion_list),
                                    filter_expression,
                                    bytecode_len,
                                    (ctx && bytecode_len) ? &ctx->bytecode->b : nullptr,
This page took 0.026118 seconds and 4 git commands to generate.