Fix: unchecked buffer size for communication header
[lttng-tools.git] / src / common / buffer-view.c
index 6f674f4a9828f857ada1a5e2fc3038d00ba343ba..7337dbb06156bc62a118fee12ce23a8887fadbaa 100644 (file)
@@ -18,6 +18,12 @@ struct lttng_buffer_view lttng_buffer_view_init(
        return view;
 }
 
        return view;
 }
 
+LTTNG_HIDDEN
+bool lttng_buffer_view_is_valid(const struct lttng_buffer_view *view)
+{
+       return view && view->data && view->size > 0;
+}
+
 LTTNG_HIDDEN
 struct lttng_buffer_view lttng_buffer_view_from_view(
                const struct lttng_buffer_view *src, size_t offset,
 LTTNG_HIDDEN
 struct lttng_buffer_view lttng_buffer_view_from_view(
                const struct lttng_buffer_view *src, size_t offset,
This page took 0.031756 seconds and 4 git commands to generate.