Silence bogus Coverity warning of uninitialized value
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 6 May 2017 18:59:48 +0000 (14:59 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 6 May 2017 19:55:06 +0000 (15:55 -0400)
Coverity complains that struct lttng_notification_comm's
payload field is not initialized. "payload" is a flexible
array member which should be ignored. Normally, a such a
member _could_ result in additional padding added at the
end of the structure. In this case, the structure is declared
as packed.

Nonetheless, using a designated initializer gets rid of the
ambiguity and silences Coverity.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/notification.c

index 5062ca5b1afa16f26340871a878801723ffce825..785af6816f4453e5ed2b06e5845f3eea1f5e4e6c 100644 (file)
@@ -50,7 +50,7 @@ ssize_t lttng_notification_serialize(struct lttng_notification *notification,
                char *buf)
 {
        ssize_t ret, condition_size, evaluation_size, offset = 0;
-       struct lttng_notification_comm notification_comm;
+       struct lttng_notification_comm notification_comm = { 0 };
 
        if (!notification) {
                ret = -1;
This page took 0.025561 seconds and 4 git commands to generate.