Fix: illegal memory access in init_ust_event_from_agent_event
[lttng-tools.git] / src / bin / lttng-sessiond / save.c
index 489446d6311dc4d8048f5f525cf91fcab1e7eaa9..9ac7712cb114968fdb8c3c4605a4f2f10419037b 100644 (file)
@@ -708,7 +708,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.023944 seconds and 4 git commands to generate.