From f71e6c44610a5d8a3586b1681bcd3f1a67846de1 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Thu, 19 Oct 2023 10:41:10 -0600 Subject: [PATCH] lib: cmetrics: upgrade to v0.6.4 Signed-off-by: Eduardo Silva --- lib/cmetrics/CMakeLists.txt | 2 +- lib/cmetrics/src/cmt_decode_msgpack.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/cmetrics/CMakeLists.txt b/lib/cmetrics/CMakeLists.txt index 38a86e5f44b..4d241d833d9 100644 --- a/lib/cmetrics/CMakeLists.txt +++ b/lib/cmetrics/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # CMetrics Version set(CMT_VERSION_MAJOR 0) set(CMT_VERSION_MINOR 6) -set(CMT_VERSION_PATCH 3) +set(CMT_VERSION_PATCH 4) set(CMT_VERSION_STR "${CMT_VERSION_MAJOR}.${CMT_VERSION_MINOR}.${CMT_VERSION_PATCH}") # Include helpers diff --git a/lib/cmetrics/src/cmt_decode_msgpack.c b/lib/cmetrics/src/cmt_decode_msgpack.c index 2e1cf31be47..4ede1bdd9ed 100644 --- a/lib/cmetrics/src/cmt_decode_msgpack.c +++ b/lib/cmetrics/src/cmt_decode_msgpack.c @@ -977,8 +977,11 @@ static int unpack_basic_type_meta(mpack_reader_t *reader, size_t index, void *co result = cmt_mpack_unpack_map(reader, callbacks, context); if (CMT_DECODE_MSGPACK_SUCCESS == result) { - decode_context->map->label_count = cfl_list_size(&decode_context->map->label_keys); + if (decode_context->map == NULL || decode_context->map->parent == NULL) { + return CMT_DECODE_MSGPACK_INVALID_ARGUMENT_ERROR; + } + decode_context->map->label_count = cfl_list_size(&decode_context->map->label_keys); if (decode_context->map->type == CMT_HISTOGRAM) { histogram = (struct cmt_histogram *) decode_context->map->parent;