From 43c445e3ea9a4290e4c60d427bf6435e91bafa65 Mon Sep 17 00:00:00 2001 From: Guerra Mattia Date: Wed, 23 Aug 2017 11:08:56 +0200 Subject: AMUtil: use DLT API only when DLT is selected Protecting access to DLT API dlt_user_is_logLevel_enabled by checking if destination is really meant to be DLT daemon. Otherwise, invalid DLT Context could be accessed. Signed-off-by: Guerra Mattia --- AudioManagerUtilities/include/CAmDltWrapper.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/AudioManagerUtilities/include/CAmDltWrapper.h b/AudioManagerUtilities/include/CAmDltWrapper.h index 8c5678e..79df911 100644 --- a/AudioManagerUtilities/include/CAmDltWrapper.h +++ b/AudioManagerUtilities/include/CAmDltWrapper.h @@ -162,11 +162,14 @@ public: { #ifdef WITH_DLT #ifdef DLT_IS_LOG_LEVEL_ENABLED - return (dlt_user_is_logLevel_enabled(&mDltContext, logLevel) == DLT_RETURN_TRUE); + if (mlogDestination == logDestination::DAEMON) + { + return (dlt_user_is_logLevel_enabled(&mDltContext, logLevel) == DLT_RETURN_TRUE); + } #else (void)logLevel; - return true; #endif + return true; #else return (logLevel <= mDltContext.log_level_user); #endif -- cgit v1.2.1