Fix: NULL pointer dereference in lttng_condition_serialize
[lttng-tools.git] / src / common / condition.c
index ceab81eabbd81a6928a9b6122a6fdb117940a4b8..98c97a595016c772c54aead040809005f6838be2 100644 (file)
@@ -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) {
This page took 0.02299 seconds and 4 git commands to generate.