From cf7dc36cf7fedff5fe727c4f417dc58555a13769 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Mon, 11 Nov 2019 02:04:49 +0100 Subject: [PATCH] added return value check(coverity STREAM_FORMAT_STATE) --- contrib/epee/include/serialization/keyvalue_helpers.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/epee/include/serialization/keyvalue_helpers.h b/contrib/epee/include/serialization/keyvalue_helpers.h index 9d0f1d74..0cf99221 100644 --- a/contrib/epee/include/serialization/keyvalue_helpers.h +++ b/contrib/epee/include/serialization/keyvalue_helpers.h @@ -61,8 +61,10 @@ namespace epee t_pod_type transform_str_to_t_pod(const std::string& a) { t_pod_type res = AUTO_VAL_INIT(res); - epee::string_tools::hex_to_pod(a, res); + if (!epee::string_tools::hex_to_pod(a, res)) + throw std::runtime_error(std::string("Unable to transform \"") + a + "\" to pod type " + typeid(t_pod_type).name()); return res; + CHECK_AND_ASSERT_THROW_MES } //basic helpers for blob-to-hex serialization