remove vulnerable function 'strerror'
authorYoungjae Shin <yj99.shin@samsung.com>
Mon, 24 Feb 2020 05:47:29 +0000 (14:47 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Wed, 18 Mar 2020 08:53:50 +0000 (17:53 +0900)
supervisor/ModeCareTaker.cpp
supervisor/ModeManager.cpp
supervisor/PluginMapper.cpp
supervisor/RuleManager.cpp

index 3e7c710ccdb26dff868d79a3844fa9ac7a2dfcc7..c362511bbe8068a3e11f9e8e60f86ce6b052f799 100644 (file)
@@ -57,7 +57,7 @@ int ModeCareTaker::popMode(const std::string &name, Mode &mode)
 
        std::string filePath = undoDir + "/tizen_" + name + MODES_UNDO_FILE_SUFFIX;
        if (0 != remove(filePath.c_str()))
-               ERR("remove(%s) Fail(%s)", filePath.c_str(), strerror(errno));
+               ERR("remove(%s) Fail(%d)", filePath.c_str(), errno);
 
        for (auto it = essentialMap.begin(); it != essentialMap.end(); ) {
                if (it->second == name)
index 03693732bc58bbe9056b6fcd2d4bdc59647491c9..2e533bcc10f93bbbe7b4cfc950aa0ef33722fa1e 100644 (file)
@@ -208,7 +208,7 @@ bool ModeManager::makeModeMap(const string &dirPath)
 
        DIR *dir;
        if ((dir = opendir(dirPath.c_str())) == NULL) {
-               ERR("opendir(%s) Fail(%s)", dirPath.c_str(), strerror(errno));
+               ERR("opendir(%s) Fail(%d)", dirPath.c_str(), errno);
                return false;
        }
 
@@ -244,7 +244,7 @@ bool ModeManager::restoreUndoInfo(const string &dirPath)
 
        DIR *dir;
        if ((dir = opendir(dirPath.c_str())) == NULL) {
-               ERR("opendir(%s) Fail(%s)", dirPath.c_str(), strerror(errno));
+               ERR("opendir(%s) Fail(%d)", dirPath.c_str(), errno);
                return false;
        }
 
@@ -276,7 +276,7 @@ bool ModeManager::restoreUndoInfo(const string &dirPath)
                } catch (std::exception &e) {
                        ERR("parser(%s) Fail(%s)", fileFullPath.c_str(), e.what());
                        if (0 != remove(fileFullPath.c_str()))
-                               ERR("remove(%s) Fail(%s)", fileFullPath.c_str(), strerror(errno));
+                               ERR("remove(%s) Fail(%d)", fileFullPath.c_str(), errno);
                }
        }
 
index 92c501c32f80fdaace7fd9ef86eedeb96c275063..55ff3f546395a6e8ca8a1d806eb3ccb97fe39bc5 100644 (file)
@@ -36,7 +36,7 @@ int PluginMapper::loadPlugins()
 {
        DIR *dir;
        if ((dir = opendir(pluginDir.c_str())) == NULL) {
-               ERR("opendir(%s) Fail(%s)", pluginDir.c_str(), strerror(errno));
+               ERR("opendir(%s) Fail(%d)", pluginDir.c_str(), errno);
                throw ModesEx(ModesEx::SYSTEM_ERROR);
        }
 
index e0faa6deb261b8c6fa0d05c0990175159a0d50d6..55186c62e5e785ca39927b7f37a8599644e075ae 100644 (file)
@@ -56,7 +56,7 @@ void RuleManager::makeRuleMap()
 
        DIR *dir;
        if ((dir = opendir(ruleDir.c_str())) == NULL)
-               ERR("opendir(%s) Fail(%s)", ruleDir.c_str(), strerror(errno));
+               ERR("opendir(%s) Fail(%d)", ruleDir.c_str(), errno);
 
        struct dirent *entry;
        while ((entry = readdir(dir)) != NULL) {