From: Jérémie Galarneau Date: Sun, 7 May 2017 19:51:42 +0000 (-0400) Subject: Fix: NULL pointer dereference in lttng_condition_serialize X-Git-Tag: v2.11.0-rc1~601 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=68f4e86d1be0ca47e0ff726952f8536ae25dcaf1;p=lttng-tools.git Fix: NULL pointer dereference in lttng_condition_serialize Reported-by: Coverity Scan *** CID 1374823: Null pointer dereferences (REVERSE_INULL) Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/condition.c b/src/common/condition.c index ceab81eab..98c97a595 100644 --- a/src/common/condition.c +++ b/src/common/condition.c @@ -67,7 +67,8 @@ ssize_t lttng_condition_serialize(const struct lttng_condition *condition, { ssize_t ret, condition_size; struct lttng_condition_comm condition_comm = { - .condition_type = (int8_t) condition->type + .condition_type = (int8_t) (condition ? + condition->type : LTTNG_CONDITION_TYPE_UNKNOWN) }; if (!condition) {