Fix: lttng-sessiond: Taking sizeof of a pointer
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 13 Jan 2021 17:04:49 +0000 (12:04 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 3 Feb 2021 19:39:22 +0000 (14:39 -0500)
Reported by clang-tidy:
  bugprone-sizeof-expression: Suspicious usage of `sizeof(A*)`

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ie3069ad3d81d460646c71923f0f396cf18980540

src/bin/lttng-sessiond/client.c

index 6c17ea2c1c24995a66439bcc2b3b60228c7fadcc..e1552c345659184d7c3973393a656c520a7f85e5 100644 (file)
@@ -2629,8 +2629,7 @@ static void *thread_manage_clients(void *data)
                        struct lttcomm_lttng_msg *llm = (typeof(
                                        llm)) cmd_ctx.reply_payload.buffer.data;
 
-                       assert(cmd_ctx.reply_payload.buffer.size >=
-                              sizeof(llm));
+                       assert(cmd_ctx.reply_payload.buffer.size >= sizeof(*llm));
                        assert(cmd_ctx.lttng_msg_size == cmd_ctx.reply_payload.buffer.size);
 
                        llm->fd_count = lttng_payload_view_get_fd_handle_count(&view);
This page took 0.02605 seconds and 4 git commands to generate.