-
Notifications
You must be signed in to change notification settings - Fork 6
RDK-60308-[tr69hostif, RFC] RDK Coverity Defect Resolution for Device Management #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from 10 commits
3d10f07
3d9ee80
ac48d81
00ef0b0
c88863b
a292ffd
87e20be
c4ee59b
7c5dcbc
59325ac
f647fec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1295,13 +1295,12 @@ void RuntimeFeatureControlProcessor::clearDB(void) | |||||
| std::ofstream touch_file(TR181STOREFILE); | ||||||
| touch_file.close(); | ||||||
|
|
||||||
| RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] Clearing DB Value: %s\n", __FUNCTION__,__LINE__,ClearDB.c_str()); | ||||||
| set_RFCProperty(name, ClearDB, clearValue); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coverity Issue - Variable copied when it could be moved"ClearDB" is passed-by-value as parameter to "std::__cxx11::basic_string<char, std::char_traits, std::allocator >::basic_string(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const &)", when it could be moved instead. Low Impact, CWE-none How to fixUse "std::move(""ClearDB"")" instead of "ClearDB". |
||||||
| set_RFCProperty(name, BootstrapClearDB, clearValue); | ||||||
| set_RFCProperty(name, ConfigChangeTimeKey, ConfigChangeTime); | ||||||
|
|
||||||
| RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] Clearing DB Value: %s\n", __FUNCTION__,__LINE__,ClearDB.c_str()); | ||||||
| RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] Bootstrap Clearing DB Value: %s\n", __FUNCTION__,__LINE__,BootstrapClearDB.c_str()); | ||||||
| set_RFCProperty(name, BootstrapClearDB, clearValue); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coverity Issue - Variable copied when it could be moved"BootstrapClearDB" is passed-by-value as parameter to "std::__cxx11::basic_string<char, std::char_traits, std::allocator >::basic_string(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const &)", when it could be moved instead. Low Impact, CWE-none How to fixUse "std::move(""BootstrapClearDB"")" instead of "BootstrapClearDB". |
||||||
| RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] ConfigChangeTime: %s\n", __FUNCTION__,__LINE__,ConfigChangeTime.c_str()); | ||||||
| set_RFCProperty(name, ConfigChangeTimeKey, ConfigChangeTime); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coverity Issue - Variable copied when it could be moved"ConfigChangeTime" is passed-by-value as parameter to "std::__cxx11::basic_string<char, std::char_traits, std::allocator >::basic_string(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const &)", when it could be moved instead. Low Impact, CWE-none How to fixUse "std::move(""ConfigChangeTime"")" instead of "ConfigChangeTime". |
||||||
|
|
||||||
| #else | ||||||
| RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] Clearing tr181 store\n", __FUNCTION__,__LINE__); | ||||||
|
|
@@ -1370,14 +1369,14 @@ void RuntimeFeatureControlProcessor::clearDBEnd(void){ | |||||
| std::string ClearDBEndKey = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Control.ClearDBEnd"; | ||||||
| std::string BootstrapClearDBEndKey = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Bootstrap.Control.ClearDBEnd"; | ||||||
| std::string reloadCacheKey = "RFC_CONTROL_RELOADCACHE"; | ||||||
|
|
||||||
| set_RFCProperty(name, ClearDBEndKey, clearValue); | ||||||
| set_RFCProperty(name, BootstrapClearDBEndKey, clearValue); | ||||||
| set_RFCProperty(name, reloadCacheKey, clearValue); | ||||||
|
|
||||||
| RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] Clearing DBEnd Key Value: %s\n", __FUNCTION__,__LINE__,ClearDBEndKey.c_str()); | ||||||
| RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] Bootstrap Clearing DBEnd Key Value: %s\n", __FUNCTION__,__LINE__,BootstrapClearDBEndKey.c_str()); | ||||||
| RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] Reload Cache Key: %s\n", __FUNCTION__,__LINE__,reloadCacheKey.c_str()); | ||||||
| set_RFCProperty(name, ClearDBEndKey, clearValue); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coverity Issue - Variable copied when it could be moved"ClearDBEndKey" is passed-by-value as parameter to "std::__cxx11::basic_string<char, std::char_traits, std::allocator >::basic_string(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const &)", when it could be moved instead. Low Impact, CWE-none How to fixUse "std::move(""ClearDBEndKey"")" instead of "ClearDBEndKey". |
||||||
| set_RFCProperty(name, BootstrapClearDBEndKey, clearValue); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coverity Issue - Variable copied when it could be moved"BootstrapClearDBEndKey" is passed-by-value as parameter to "std::__cxx11::basic_string<char, std::char_traits, std::allocator >::basic_string(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const &)", when it could be moved instead. Low Impact, CWE-none How to fixUse "std::move(""BootstrapClearDBEndKey"")" instead of "BootstrapClearDBEndKey". |
||||||
| set_RFCProperty(name, reloadCacheKey, clearValue); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coverity Issue - Variable copied when it could be moved"reloadCacheKey" is passed-by-value as parameter to "std::__cxx11::basic_string<char, std::char_traits, std::allocator >::basic_string(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const &)", when it could be moved instead. Low Impact, CWE-none How to fixUse "std::move(""reloadCacheKey"")" instead of "reloadCacheKey". |
||||||
|
|
||||||
| } | ||||||
|
|
||||||
| void RuntimeFeatureControlProcessor::updateHashInDB(std::string configSetHash) | ||||||
|
|
@@ -1387,7 +1386,7 @@ void RuntimeFeatureControlProcessor::updateHashInDB(std::string configSetHash) | |||||
| #if !defined(RDKB_SUPPORT) | ||||||
| std::string ConfigSetHashName = "ConfigSetHash"; | ||||||
| std::string ConfigSetHash_key = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Control.ConfigSetHash"; | ||||||
| set_RFCProperty(ConfigSetHashName, ConfigSetHash_key, configSetHash); | ||||||
| set_RFCProperty(std::move(ConfigSetHashName), std::move(ConfigSetHash_key), configSetHash); | ||||||
|
||||||
| set_RFCProperty(std::move(ConfigSetHashName), std::move(ConfigSetHash_key), configSetHash); | |
| set_RFCProperty(ConfigSetHashName, ConfigSetHash_key, configSetHash); |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary use of std::move on local variables that are only used once. The function signature set_RFCProperty(std::string name, std::string key, std::string value) takes all parameters by value, which means they will be copied regardless of std::move. Since ConfigSetTimeName and ConfigSetTime_Key are local variables that are not used after this call, the compiler's copy elision and move semantics will automatically optimize this. Using std::move here doesn't provide any benefit and makes the code less readable.
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation: These lines use tabs while surrounding code uses spaces. Consider maintaining consistent indentation style throughout the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation: Lines 1990, 1993, and 2001 use tabs while surrounding code uses spaces. This violates the consistent indentation pattern seen throughout the file. Consider maintaining consistent indentation style (appears to be 4 spaces based on surrounding context).
Uh oh!
There was an error while loading. Please reload this page.