Fix: illegal memory access in init_ust_event_from_agent_event
[lttng-tools.git] / src / bin / lttng-sessiond / save.c
index 59cd1e171cfba6953047b916c1e65b47d14d89a8..c4abf813c341ae77718f8151808b5f75c1f54b18 100644 (file)
@@ -693,7 +693,11 @@ int init_ust_event_from_agent_event(struct ltt_ust_event *ust_event,
 
        ust_event->enabled = agent_event->enabled;
        ust_event->attr.instrumentation = LTTNG_UST_TRACEPOINT;
-       strncpy(ust_event->attr.name, agent_event->name, LTTNG_SYMBOL_NAME_LEN);
+       if (lttng_strncpy(ust_event->attr.name, agent_event->name,
+                       LTTNG_SYMBOL_NAME_LEN)) {
+               ret = -1;
+               goto end;
+       }
        switch (agent_event->loglevel_type) {
        case LTTNG_EVENT_LOGLEVEL_ALL:
                ust_loglevel_type = LTTNG_UST_LOGLEVEL_ALL;
This page took 0.032255 seconds and 4 git commands to generate.