Silence bogus Coverity warning of uninitialized value
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 6 May 2017 19:04:27 +0000 (15:04 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 6 May 2017 19:43:28 +0000 (15:43 -0400)
Coverity complains that struct lttng_trigger_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/trigger.c

index 13f26d6613dea4a1e6cd469aa034fb34d744cc5f..ab2404ca5224c63f3a2137769fe6eb92175911c5 100644 (file)
@@ -148,7 +148,7 @@ error:
 LTTNG_HIDDEN
 ssize_t lttng_trigger_serialize(struct lttng_trigger *trigger, char *buf)
 {
-       struct lttng_trigger_comm trigger_comm;
+       struct lttng_trigger_comm trigger_comm = { 0 };
        ssize_t action_size, condition_size, offset = 0, ret;
 
        if (!trigger) {
This page took 0.02616 seconds and 4 git commands to generate.