Fix: extra '%' causes babeltrace2 to abort() in logging code
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 8 Aug 2019 02:21:02 +0000 (22:21 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Sep 2019 15:58:20 +0000 (11:58 -0400)
An extra '%' in a TRACE logging statement causes
bt_common_custom_vsnprintf() to interpret '!' as a conversion
specifier. This causes handle_conversion_specifier_bt() to invoke
abort().

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ia077616ea84559dfc3abb57d6404d06a6e9b7baf
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1836
Tested-by: jenkins <jenkins@lttng.org>
src/lib/graph/query-executor.c

index cf265fd3a8e74a8e3ce6dbe43ed9f018a5d0a303..efd6b51f6fefec49e64e26340e855cf41233605f 100644 (file)
@@ -77,7 +77,7 @@ struct bt_query_executor *bt_query_executor_create_with_method_data(
        BT_ASSERT_PRE_NON_NULL(comp_cls, "Component class");
        BT_ASSERT_PRE_NON_NULL(object, "Object");
        BT_LIB_LOGD("Creating query executor: "
-               "%![comp-cls-]+C, object=\"%s\", %![params-]%+v",
+               "%![comp-cls-]+C, object=\"%s\", %![params-]+v",
                comp_cls, object, params);
        query_exec = g_new0(struct bt_query_executor, 1);
        if (!query_exec) {
@@ -126,7 +126,7 @@ struct bt_query_executor *bt_query_executor_create_with_method_data(
        bt_object_init_shared(&query_exec->base,
                bt_query_executor_destroy);
        BT_LIB_LOGD("Created query executor: "
-               "addr=%p, %![comp-cls-]+C, object=\"%s\", %![params-]%+v",
+               "addr=%p, %![comp-cls-]+C, object=\"%s\", %![params-]+v",
                query_exec, comp_cls, object, params);
 
 end:
This page took 0.026607 seconds and 4 git commands to generate.