Fix: Explicit null dereferenced
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 24 Jul 2017 21:00:08 +0000 (17:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 7 Aug 2017 20:42:34 +0000 (16:42 -0400)
Found by Coverity:

CID 1376244 (#3 of 3): Explicit null dereferenced (FORWARD_NULL)
10. var_deref_op: Dereferencing null pointer node.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/ctf/common/metadata/visitor-generate-ir.c

index 8cf147ece4e7f9167fdbc1a377224efb9c991c4d..f8f9538bf89d45ca34f7e535e138b6384d35a3c1 100644 (file)
@@ -1650,7 +1650,7 @@ int visit_typealias(struct ctx *ctx, struct ctf_node *target,
        /* Do not allow typedef and typealias of untagged variants */
        if (bt_ctf_field_type_is_variant(type_decl)) {
                if (bt_ctf_field_type_variant_get_tag_name(type_decl)) {
-                       _BT_LOGE_NODE(node,
+                       _BT_LOGE_NODE(target,
                                "Type definition of untagged variant field type is not allowed.");
                        ret = -EPERM;
                        goto end;
@@ -1662,7 +1662,7 @@ int visit_typealias(struct ctx *ctx, struct ctf_node *target,
         * abstract or not (if it has an identifier). Check it here.
         */
        if (qdummy_field_name != 0) {
-               _BT_LOGE_NODE(node,
+               _BT_LOGE_NODE(target,
                        "Expecting empty identifier: id=\"%s\"",
                        g_quark_to_string(qdummy_field_name));
                ret = -EINVAL;
This page took 0.025673 seconds and 4 git commands to generate.