Fix: possible NULL pointer dereference in CTF Writer/IR tests
[babeltrace.git] / tests / lib / test_ctf_writer.c
index dfc918398b17d542a8b1c25c331c3a6f31303b27..57c64858788bca06d6525158f89fab067587d559 100644 (file)
@@ -566,7 +566,7 @@ void append_simple_event(struct bt_ctf_stream_class *stream_class,
        bt_ctf_event_set_payload(simple_event, "enum_field_unsigned",
                enum_field_unsigned);
        ret_char = bt_ctf_field_enumeration_get_mapping_name(enum_field_unsigned);
-       ok(!strcmp(ret_char, mapping_name_test),
+       ok(ret_char && !strcmp(ret_char, mapping_name_test),
                "bt_ctf_field_enumeration_get_mapping_name returns the correct mapping name with an unsigned container");
 
        ok(bt_ctf_clock_set_time(clock, current_time) == 0, "Set clock time");
This page took 0.023121 seconds and 4 git commands to generate.