Fix: truncation of text array and sequences by NULL terminator
[lttng-ust.git] / liblttng-ust / lttng-ring-buffer-client.h
index 73f3deb8e341d4d337af9329a07fa7cd296707bc..8e14acf5fc3caebad3ad2ad54c0ed52001a979c2 100644 (file)
@@ -763,6 +763,13 @@ void lttng_event_strcpy(struct lttng_ust_lib_ring_buffer_ctx *ctx, const char *s
        lib_ring_buffer_strcpy(&client_config, ctx, src, len, '#');
 }
 
+static
+void lttng_event_pstrcpy_pad(struct lttng_ust_lib_ring_buffer_ctx *ctx,
+                    const char *src, size_t len)
+{
+       lib_ring_buffer_pstrcpy(&client_config, ctx, src, len, '\0');
+}
+
 #if 0
 static
 wait_queue_head_t *lttng_get_reader_wait_queue(struct lttng_ust_lib_ring_buffer_channel *chan)
@@ -812,8 +819,8 @@ int lttng_flush_buffer(struct lttng_ust_lib_ring_buffer_channel *chan,
 static struct lttng_transport lttng_relay_transport = {
        .name = "relay-" RING_BUFFER_MODE_TEMPLATE_STRING "-mmap",
        .ops = {
-               .struct_size = sizeof(struct lttng_ust_channel_ops),
-               .priv = __LTTNG_COMPOUND_LITERAL(struct lttng_ust_channel_ops_private, {
+               .struct_size = sizeof(struct lttng_ust_channel_buffer_ops),
+               .priv = __LTTNG_COMPOUND_LITERAL(struct lttng_ust_channel_buffer_ops_private, {
                        .pub = &lttng_relay_transport.ops,
                        .channel_create = _channel_create,
                        .channel_destroy = lttng_channel_destroy,
@@ -826,6 +833,7 @@ static struct lttng_transport lttng_relay_transport = {
                .event_commit = lttng_event_commit,
                .event_write = lttng_event_write,
                .event_strcpy = lttng_event_strcpy,
+               .event_pstrcpy_pad = lttng_event_pstrcpy_pad,
        },
        .client_config = &client_config,
 };
This page took 0.023953 seconds and 4 git commands to generate.