Fix coverity warning about sizeof(void **) != sizeof(void *)
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 12 Nov 2014 21:06:34 +0000 (16:06 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 10 Apr 2015 20:41:45 +0000 (16:41 -0400)
The size of the copied data is actually void *, not void **.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
probes/lttng-events.h

index ce4c3f125a43814251f9a3c26434973898e497a6..0c92c17f0a1ddd98625f23552d5f5ad80a418964 100644 (file)
@@ -438,8 +438,8 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len,             \
                const void *__ctf_tmp_ptr = (_src);                            \
                memcpy(__stack_data, &__ctf_tmp_ulong, sizeof(unsigned long)); \
                __stack_data += sizeof(unsigned long);                         \
-               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void **));         \
-               __stack_data += sizeof(void **);                               \
+               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void *));          \
+               __stack_data += sizeof(void *);                                \
        }
 
 #undef _ctf_sequence_encoded
@@ -450,16 +450,16 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len,           \
                const void *__ctf_tmp_ptr = (_src);                            \
                memcpy(__stack_data, &__ctf_tmp_ulong, sizeof(unsigned long)); \
                __stack_data += sizeof(unsigned long);                         \
-               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void **));         \
-               __stack_data += sizeof(void **);                               \
+               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void *));          \
+               __stack_data += sizeof(void *);                                \
        }
 
 #undef _ctf_string
 #define _ctf_string(_item, _src, _user, _nowrite)                             \
        {                                                                      \
                const void *__ctf_tmp_ptr = (_src);                            \
-               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void **));         \
-               __stack_data += sizeof(void **);                               \
+               memcpy(__stack_data, &__ctf_tmp_ptr, sizeof(void *));          \
+               __stack_data += sizeof(void *);                                \
        }
 
 #undef TP_PROTO
This page took 0.027711 seconds and 4 git commands to generate.