summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuerra Mattia <mguerra@de.adit-jv.com>2017-08-23 11:08:56 +0200
committerJens Lorenz <jlorenz@de.adit-jv.com>2017-09-29 11:42:01 +0200
commit43c445e3ea9a4290e4c60d427bf6435e91bafa65 (patch)
treea8c610cb6f4b17d6893b626104132ee58d5359cd
parent50bbb68460af25dcba4110b11b4f0bf61d6e111a (diff)
downloadaudiomanager-43c445e3ea9a4290e4c60d427bf6435e91bafa65.tar.gz
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 <mguerra@de.adit-jv.com>
-rw-r--r--AudioManagerUtilities/include/CAmDltWrapper.h7
1 files 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