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;