Fix ctf-writer: Reject enumerations containing no mappings
[babeltrace.git] / formats / ctf / writer / event-fields.c
index ff970c0a86959fee1ce87ddcd2138dcb2b1b4c92..ad4fcb5a06c1ed5d3ad4e5636fdfab603f832623 100644 (file)
@@ -179,8 +179,8 @@ struct bt_ctf_field *bt_ctf_field_create(struct bt_ctf_field_type *type)
        }
 
        type_id = bt_ctf_field_type_get_type_id(type);
-       if (type_id <= CTF_TYPE_UNKNOWN ||
-               type_id >= NR_CTF_TYPES) {
+       if (type_id <= CTF_TYPE_UNKNOWN || type_id >= NR_CTF_TYPES ||
+               bt_ctf_field_type_validate(type)) {
                goto error;
        }
 
This page took 0.023274 seconds and 4 git commands to generate.