Be more restrictive in provider name check
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 16 Apr 2015 21:14:53 +0000 (17:14 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 16 Apr 2015 21:14:53 +0000 (17:14 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-probes.c

index b5a7fc8024401da8d19d0f132a122bd63c1c64c9..ee75e33d7881f9528043dd492a63351ef73714de 100644 (file)
@@ -60,6 +60,14 @@ int check_event_provider(struct lttng_probe_desc *desc)
                                desc->provider,
                                provider_name_len))
                        return 0;       /* provider mismatch */
+               /*
+                * The event needs to contain at least provider name + _ +
+                * one or more letter.
+                */
+               if (strlen(desc->event_desc[i]->name) <= provider_name_len + 1)
+                       return 0;       /* provider mismatch */
+               if (desc->event_desc[i]->name[provider_name_len] != '_')
+                       return 0;       /* provider mismatch */
        }
        return 1;
 }
This page took 0.030091 seconds and 4 git commands to generate.