Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 223 Examining data/grub-customizer-5.1.0/src/config.hpp Examining data/grub-customizer-5.1.0/src/main/client.cpp Examining data/grub-customizer-5.1.0/src/main/proxy.cpp Examining data/grub-customizer-5.1.0/src/Mapper/EntryName.hpp Examining data/grub-customizer-5.1.0/src/Mapper/EntryNameImpl.hpp Examining data/grub-customizer-5.1.0/src/Bootstrap/Factory.hpp Examining data/grub-customizer-5.1.0/src/Bootstrap/View.hpp Examining data/grub-customizer-5.1.0/src/Bootstrap/GtkView.cpp Examining data/grub-customizer-5.1.0/src/Bootstrap/GtkApplication.cpp Examining data/grub-customizer-5.1.0/src/Bootstrap/FactoryImpl/GlibThread.cpp Examining data/grub-customizer-5.1.0/src/Bootstrap/FactoryImpl/GLibRegex.cpp Examining data/grub-customizer-5.1.0/src/Bootstrap/Application.hpp Examining data/grub-customizer-5.1.0/src/View/Trait/ViewAware.hpp Examining data/grub-customizer-5.1.0/src/View/About.hpp Examining data/grub-customizer-5.1.0/src/View/EntryEditor.hpp Examining data/grub-customizer-5.1.0/src/View/Settings.hpp Examining data/grub-customizer-5.1.0/src/View/EnvEditor.hpp Examining data/grub-customizer-5.1.0/src/View/Installer.hpp Examining data/grub-customizer-5.1.0/src/View/Trash.hpp Examining data/grub-customizer-5.1.0/src/View/Model/ListItem.hpp Examining data/grub-customizer-5.1.0/src/View/Error.hpp Examining data/grub-customizer-5.1.0/src/View/Main.hpp Examining data/grub-customizer-5.1.0/src/View/ColorChooser.hpp Examining data/grub-customizer-5.1.0/src/View/Gtk/Trash.hpp Examining data/grub-customizer-5.1.0/src/View/Gtk/Main.hpp Examining data/grub-customizer-5.1.0/src/View/Gtk/About.hpp Examining data/grub-customizer-5.1.0/src/View/Gtk/EntryEditor.hpp Examining data/grub-customizer-5.1.0/src/View/Gtk/Settings.hpp Examining data/grub-customizer-5.1.0/src/View/Gtk/Element/PartitionChooser.hpp Examining data/grub-customizer-5.1.0/src/View/Gtk/Element/List.hpp Examining data/grub-customizer-5.1.0/src/View/Gtk/EnvEditor.hpp Examining data/grub-customizer-5.1.0/src/View/Gtk/Theme.hpp Examining data/grub-customizer-5.1.0/src/View/Gtk/Error.hpp Examining data/grub-customizer-5.1.0/src/View/Gtk/Installer.hpp Examining data/grub-customizer-5.1.0/src/View/Theme.hpp Examining data/grub-customizer-5.1.0/src/lib/CsvProcessor.hpp Examining data/grub-customizer-5.1.0/src/lib/Logger.hpp Examining data/grub-customizer-5.1.0/src/lib/Helper.hpp Examining data/grub-customizer-5.1.0/src/lib/FileSystem.hpp Examining data/grub-customizer-5.1.0/src/lib/Mutex.hpp Examining data/grub-customizer-5.1.0/src/lib/ContentParserFactory.hpp Examining data/grub-customizer-5.1.0/src/lib/Regex/GLib.hpp Examining data/grub-customizer-5.1.0/src/lib/Type.hpp Examining data/grub-customizer-5.1.0/src/lib/Logger/Stream.hpp Examining data/grub-customizer-5.1.0/src/lib/Mutex/GLib.hpp Examining data/grub-customizer-5.1.0/src/lib/Regex.hpp Examining data/grub-customizer-5.1.0/src/lib/Exception.hpp Examining data/grub-customizer-5.1.0/src/lib/ContentParser.hpp Examining data/grub-customizer-5.1.0/src/lib/ContentParser/Chainloader.hpp Examining data/grub-customizer-5.1.0/src/lib/ContentParser/Linux.hpp Examining data/grub-customizer-5.1.0/src/lib/ContentParser/FactoryImpl.hpp Examining data/grub-customizer-5.1.0/src/lib/ContentParser/Abstract.hpp Examining data/grub-customizer-5.1.0/src/lib/ContentParser/Memtest.hpp Examining data/grub-customizer-5.1.0/src/lib/ContentParser/LinuxIso.hpp Examining data/grub-customizer-5.1.0/src/lib/ArrayStructure.hpp Examining data/grub-customizer-5.1.0/src/lib/Trait/LoggerAware.hpp Examining data/grub-customizer-5.1.0/src/lib/Trait/ActionLoggerAware.hpp Examining data/grub-customizer-5.1.0/src/Controller/MainController.hpp Examining data/grub-customizer-5.1.0/src/Controller/InstallerController.hpp Examining data/grub-customizer-5.1.0/src/Controller/Common/ControllerAbstract.hpp Examining data/grub-customizer-5.1.0/src/Controller/TrashController.hpp Examining data/grub-customizer-5.1.0/src/Controller/EnvEditorController.hpp Examining data/grub-customizer-5.1.0/src/Controller/SettingsController.hpp Examining data/grub-customizer-5.1.0/src/Controller/AboutController.hpp Examining data/grub-customizer-5.1.0/src/Controller/ErrorController.hpp Examining data/grub-customizer-5.1.0/src/Controller/Helper/GLibThread.hpp Examining data/grub-customizer-5.1.0/src/Controller/Helper/RuleMover.hpp Examining data/grub-customizer-5.1.0/src/Controller/Helper/DeviceInfo.hpp Examining data/grub-customizer-5.1.0/src/Controller/Helper/Thread.hpp Examining data/grub-customizer-5.1.0/src/Controller/Helper/RuleMover/AbstractStrategy.hpp Examining data/grub-customizer-5.1.0/src/Controller/Helper/RuleMover/Strategy/MoveRuleOnSameLevelInsideProxy.hpp Examining data/grub-customizer-5.1.0/src/Controller/Helper/RuleMover/Strategy/MoveRuleOutOfProxyOnToplevel.hpp Examining data/grub-customizer-5.1.0/src/Controller/Helper/RuleMover/Strategy/MoveRuleIntoForeignSubmenu.hpp Examining data/grub-customizer-5.1.0/src/Controller/Helper/RuleMover/Strategy/MoveRuleOutOfSubmenu.hpp Examining data/grub-customizer-5.1.0/src/Controller/Helper/RuleMover/Strategy/MoveRuleIntoSubmenu.hpp Examining data/grub-customizer-5.1.0/src/Controller/Helper/RuleMover/Strategy/MoveForeignRuleFromSubmenuToToplevel.hpp Examining data/grub-customizer-5.1.0/src/Controller/Helper/RuleMover/MoveFailedException.hpp Examining data/grub-customizer-5.1.0/src/Controller/ThemeController.hpp Examining data/grub-customizer-5.1.0/src/Controller/EntryEditController.hpp Examining data/grub-customizer-5.1.0/src/Model/Env.hpp Examining data/grub-customizer-5.1.0/src/Model/ScriptSourceMap.hpp Examining data/grub-customizer-5.1.0/src/Model/PscriptnameTranslator.hpp Examining data/grub-customizer-5.1.0/src/Model/Rule.hpp Examining data/grub-customizer-5.1.0/src/Model/Proxylist.hpp Examining data/grub-customizer-5.1.0/src/Model/ThemeManager.hpp Examining data/grub-customizer-5.1.0/src/Model/DeviceDataList.hpp Examining data/grub-customizer-5.1.0/src/Model/SmartFileHandle.hpp Examining data/grub-customizer-5.1.0/src/Model/Proxy.hpp Examining data/grub-customizer-5.1.0/src/Model/FbResolutionsGetter.hpp Examining data/grub-customizer-5.1.0/src/Model/EntryPathBuilderImpl.hpp Examining data/grub-customizer-5.1.0/src/Model/ThemeFile.hpp Examining data/grub-customizer-5.1.0/src/Model/SettingsManagerData.hpp Examining data/grub-customizer-5.1.0/src/Model/Script.hpp Examining data/grub-customizer-5.1.0/src/Model/MountTable.hpp Examining data/grub-customizer-5.1.0/src/Model/EntryPathFollower.hpp Examining data/grub-customizer-5.1.0/src/Model/Installer.hpp Examining data/grub-customizer-5.1.0/src/Model/DeviceMap.hpp Examining data/grub-customizer-5.1.0/src/Model/ProxyScriptData.hpp Examining data/grub-customizer-5.1.0/src/Model/Theme.hpp Examining data/grub-customizer-5.1.0/src/Model/Entry.hpp Examining data/grub-customizer-5.1.0/src/Model/DeviceDataListInterface.hpp Examining data/grub-customizer-5.1.0/src/Model/Repository.hpp Examining data/grub-customizer-5.1.0/src/Model/EntryPathBuilder.hpp Examining data/grub-customizer-5.1.0/src/Model/ListCfg.hpp Examining data/grub-customizer-5.1.0/src/Model/SettingsStore.hpp FINAL RESULTS: data/grub-customizer-5.1.0/src/Model/DeviceMap.hpp:95:14: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. int size = readlink((this->env->cfg_dir_prefix + "/dev/disk/by-uuid/" + partitionUuid).c_str(), deviceBuf, 100); data/grub-customizer-5.1.0/src/Model/DeviceMap.hpp:99:11: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. size = readlink((this->env->cfg_dir_prefix + "/dev/disk/by-uuid/" + partitionUuid).c_str(), deviceBuf, 100); data/grub-customizer-5.1.0/src/Model/DeviceMap.hpp:120:16: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. int size = readlink(diskFile.c_str(), deviceBuf, 100); // if this is a link, follow it data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:138:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(outputFilePath.c_str(), 0755); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:263:16: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. int res = chmod(proxy->fileName.c_str(), 0644); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:267:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(script->fileName.c_str(), 0755); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:321:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(proxy->fileName.c_str(), proxy->permissions); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:481:6: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod((this->env->cfg_dir+"/bin/grubcfg_proxy").c_str(), 0755); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:493:6: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod((this->env->cfg_dir+"/bin/grubcfg_proxy").c_str(), 0755); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:844:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod((this->env->cfg_dir+"/"+(*iter)).c_str(), 0755); data/grub-customizer-5.1.0/src/Model/Proxy.hpp:522:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(path.c_str(), this->permissions); data/grub-customizer-5.1.0/src/Model/Script.hpp:179:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(this->fileName.c_str(), permissions); data/grub-customizer-5.1.0/src/Model/SettingsManagerData.hpp:225:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod((env->cfg_dir_prefix+"/usr/share/desktop-base/grub_background.sh").c_str(), 0755); data/grub-customizer-5.1.0/src/Controller/MainController.hpp:198:21: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE* blkidProc = popen("blkid", "r"); data/grub-customizer-5.1.0/src/Model/Env.hpp:305:16: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE* proc = popen((cmd_prefix + " which " + this->trim_cmd(cmd) + " 2>&1").c_str(), "r"); data/grub-customizer-5.1.0/src/Model/FbResolutionsGetter.hpp:52:24: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE* hwinfo_proc = popen("hwinfo --framebuffer", "r"); data/grub-customizer-5.1.0/src/Model/Installer.hpp:51:24: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE* install_proc = popen((this->env->install_cmd+" '"+device+"' 2>&1").c_str(), "r"); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:285:24: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE* mkconfigProc = popen((this->env->mkconfig_cmd + " 2> " + this->errorLogFile).c_str(), "r"); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:527:20: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE* saveProc = popen((env->update_cmd + " 2>&1").c_str(), "r"); data/grub-customizer-5.1.0/src/Model/MountTable.hpp:61:14: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. int res = system(("mount '"+device+"' '"+mountpoint+"'"+(options != "" ? " -o '"+options+"'" : "")).c_str()); data/grub-customizer-5.1.0/src/Model/MountTable.hpp:71:14: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. int res = system(("umount '"+mountpoint+"'").c_str()); data/grub-customizer-5.1.0/src/Model/SettingsManagerData.hpp:104:16: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE* proc = popen(cmd.c_str(), "r"); data/grub-customizer-5.1.0/src/Model/SettingsManagerData.hpp:132:23: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. FILE* mkfont_proc = popen(cmd.c_str(), "r"); data/grub-customizer-5.1.0/src/Model/SmartFileHandle.hpp:109:26: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. this->proc_or_file = popen(cmd_or_file.c_str(), mode.c_str()); data/grub-customizer-5.1.0/src/main/client.cpp:67:10: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return system((std::string("xhost +SI:localuser:root; pkexec ") + argv[0] + (argc == 2 ? std::string(" ") + argv[1] : "") + " no-fork; xhost -SI:localuser:root").c_str()); data/grub-customizer-5.1.0/src/lib/ContentParser/Abstract.hpp:106:27: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. char* realPathCharPtr = realpath(path.c_str(), NULL); data/grub-customizer-5.1.0/src/Model/DeviceMap.hpp:50:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). result.open(env->devicemap_file, "r", Model_SmartFileHandle::TYPE_FILE); data/grub-customizer-5.1.0/src/Model/DeviceMap.hpp:53:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). result.open(env->mkdevicemap_cmd, "r", Model_SmartFileHandle::TYPE_COMMAND); data/grub-customizer-5.1.0/src/Model/DeviceMap.hpp:82:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). result.open(staticMap, "r", Model_SmartFileHandle::TYPE_STRING); data/grub-customizer-5.1.0/src/Model/DeviceMap.hpp:94:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char deviceBuf[101]; data/grub-customizer-5.1.0/src/Model/Env.hpp:73:21: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* burg_cfg = fopen((dir_prefix + "/etc/grub-customizer/burg.cfg").c_str(), "r"); data/grub-customizer-5.1.0/src/Model/Env.hpp:94:21: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* grub_cfg = fopen((dir_prefix + "/etc/grub-customizer/grub.cfg").c_str(), "r"); data/grub-customizer-5.1.0/src/Model/Env.hpp:156:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). cfg_file = fopen((cfg_dir_prefix + "/etc/grub-customizer/burg.cfg").c_str(), "w"); data/grub-customizer-5.1.0/src/Model/Env.hpp:158:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). cfg_file = fopen((cfg_dir_prefix + "/etc/grub-customizer/grub.cfg").c_str(), "w"); data/grub-customizer-5.1.0/src/Model/Env.hpp:183:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). cfg_file = fopen((cfg_dir_prefix + "/etc/grub-customizer/viewOptions.cfg").c_str(), "w"); data/grub-customizer-5.1.0/src/Model/Env.hpp:204:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* file = fopen((cfg_dir_prefix + "/etc/grub-customizer/viewOptions.cfg").c_str(), "r"); data/grub-customizer-5.1.0/src/Model/Env.hpp:332:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* file = fopen(file_str.c_str(), "r"); data/grub-customizer-5.1.0/src/Model/Env.hpp:350:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* mtabFile = fopen("/etc/mtab", "r"); data/grub-customizer-5.1.0/src/Model/Env.hpp:388:25: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* restoreHowto = fopen((backupDir + "/RESTORE_INSTRUCTIONS").c_str(), "w"); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:130:26: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* existingScript = fopen(outputFilePath.c_str(), "r"); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:133:22: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* fwdScript = fopen(outputFilePath.c_str(), "w"); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:159:31: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* scriptForwarderFile = fopen(scriptForwarderFilePath.c_str(), "r"); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:208:25: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* proxyFile = fopen((this->env->cfg_dir+"/"+entry->d_name).c_str(), "r"); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:457:20: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* proxyBin = fopen((this->env->cfg_dir+"/bin/grubcfg_proxy").c_str(), "r"); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:471:27: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* proxyBinSource = fopen((std::string(LIBDIR)+"/grubcfg-proxy").c_str(), "r"); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:474:28: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* proxyBinTarget = fopen((this->env->cfg_dir+"/bin/grubcfg_proxy").c_str(), "w"); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:488:28: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* proxyBinTarget = fopen((this->env->cfg_dir+"/bin/grubcfg_proxy").c_str(), "w"); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:673:25: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* oldConfigFile = fopen(env->output_config_file.c_str(), "r"); data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:964:24: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* errorLogFile = fopen(this->errorLogFile.c_str(), "r"); data/grub-customizer-5.1.0/src/Model/MountTable.hpp:179:21: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* fstabFile = fopen((rootDirectory+"/etc/fstab").c_str(), "r"); data/grub-customizer-5.1.0/src/Model/MountTable.hpp:183:21: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* mtabfile = fopen("/etc/mtab", "r"); //use global mtab - the local one is unmanaged data/grub-customizer-5.1.0/src/Model/MountTable.hpp:250:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* fstab = fopen((mountpoint + "/etc/fstab").c_str(), "r"); data/grub-customizer-5.1.0/src/Model/Proxy.hpp:489:22: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* proxyFile = fopen(path.c_str(), "w"); data/grub-customizer-5.1.0/src/Model/ProxyScriptData.hpp:163:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* f = fopen(filePath.c_str(), "r"); data/grub-customizer-5.1.0/src/Model/Repository.hpp:157:18: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* script = fopen(fileName.c_str(), "w"); data/grub-customizer-5.1.0/src/Model/Repository.hpp:171:22: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* scriptFile = fopen(script->fileName.c_str(), "w"); data/grub-customizer-5.1.0/src/Model/Script.hpp:54:18: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* script = fopen(fileName.c_str(), "r"); data/grub-customizer-5.1.0/src/Model/ScriptSourceMap.hpp:59:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* file = fopen(this->_getFilePath().c_str(), "r"); data/grub-customizer-5.1.0/src/Model/ScriptSourceMap.hpp:89:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* file = fopen(this->_getFilePath().c_str(), "w"); data/grub-customizer-5.1.0/src/Model/SettingsManagerData.hpp:57:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* file = fopen(fileName.c_str(), "rb"); data/grub-customizer-5.1.0/src/Model/SettingsManagerData.hpp:60:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char nameBuf [5]; // stores 4 bytes of data (possible \0 at pos 5) data/grub-customizer-5.1.0/src/Model/SettingsManagerData.hpp:67:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sizeBuf [5]; data/grub-customizer-5.1.0/src/Model/SettingsManagerData.hpp:154:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* file = fopen(this->env->settings_file.c_str(), "r"); data/grub-customizer-5.1.0/src/Model/SettingsManagerData.hpp:189:19: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* outFile = fopen(this->env->settings_file.c_str(), "w"); data/grub-customizer-5.1.0/src/Model/SettingsManagerData.hpp:224:26: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* bgScriptFile = fopen((env->cfg_dir_prefix+"/usr/share/desktop-base/grub_background.sh").c_str(), "w"); data/grub-customizer-5.1.0/src/Model/SettingsManagerData.hpp:231:22: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* fontFile = fopen((this->env->output_config_dir + "/unicode.pf2").c_str(), "r"); data/grub-customizer-5.1.0/src/Model/SmartFileHandle.hpp:97:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). void open(std::string const& cmd_or_file, std::string const& mode, Type type) { data/grub-customizer-5.1.0/src/Model/SmartFileHandle.hpp:112:26: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). this->proc_or_file = fopen(cmd_or_file.c_str(), mode.c_str()); data/grub-customizer-5.1.0/src/Model/Theme.hpp:125:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* file = fopen(externalPath.c_str(), "r"); data/grub-customizer-5.1.0/src/Model/Theme.hpp:144:17: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* file = fopen("/tmp/grub-customizer_theme_preview", "w"); data/grub-customizer-5.1.0/src/Model/Theme.hpp:290:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char data[1024]; data/grub-customizer-5.1.0/src/Model/Theme.hpp:306:19: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* outFile = fopen(path.c_str(), "w"); data/grub-customizer-5.1.0/src/Model/Theme.hpp:318:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* file = fopen(path.c_str(), "r"); data/grub-customizer-5.1.0/src/lib/ContentParser/Abstract.hpp:119:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* file = fopen(fileName.c_str(), "r"); data/grub-customizer-5.1.0/src/lib/Helper.hpp:50:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE* file = fopen(filepath.c_str(), "r"); data/grub-customizer-5.1.0/src/lib/Helper.hpp:58:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[16]; data/grub-customizer-5.1.0/src/Model/DeviceDataList.hpp:50:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(blkidOutput)) != EOF){ data/grub-customizer-5.1.0/src/Model/Entry.hpp:46:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(sourceFile)) != EOF){ data/grub-customizer-5.1.0/src/Model/Env.hpp:308:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(proc)) != EOF) { data/grub-customizer-5.1.0/src/Model/FbResolutionsGetter.hpp:57:17: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(hwinfo_proc)) != EOF){ data/grub-customizer-5.1.0/src/Model/Installer.hpp:54:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(install_proc)) != EOF){ data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:162:16: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(scriptForwarderFile)) != EOF && c != '\n'){} //skip first line data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:164:17: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(scriptForwarderFile)) != EOF && c != '\n'){result += char(c);} //read second line (=path) data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:477:18: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(proxyBinSource)) != EOF){ data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:531:16: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(saveProc)) != EOF) { data/grub-customizer-5.1.0/src/Model/ListCfg.hpp:967:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(errorLogFile)) != EOF) { data/grub-customizer-5.1.0/src/Model/MountTable.hpp:122:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(source)) != EOF){ data/grub-customizer-5.1.0/src/Model/ProxyScriptData.hpp:52:16: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(fpProxyScript)) != EOF && !success){ data/grub-customizer-5.1.0/src/Model/ProxyScriptData.hpp:132:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(proxy_fp)) != EOF){ data/grub-customizer-5.1.0/src/Model/ProxyScriptData.hpp:139:51: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). for (int i = 0; i < textBefore.length() && (c = fgetc(proxy_fp)) != EOF; i++){ data/grub-customizer-5.1.0/src/Model/ProxyScriptData.hpp:153:16: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(proxy_fp)) != EOF){ data/grub-customizer-5.1.0/src/Model/ScriptSourceMap.hpp:64:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((dataRow = csv.read()).size()) { data/grub-customizer-5.1.0/src/Model/SettingsManagerData.hpp:106:15: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = getc(proc)) != EOF) { data/grub-customizer-5.1.0/src/Model/SettingsManagerData.hpp:135:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(mkfont_proc)) != EOF) { data/grub-customizer-5.1.0/src/Model/SettingsStore.hpp:205:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(source)) != EOF){ data/grub-customizer-5.1.0/src/Model/SmartFileHandle.hpp:59:12: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = fgetc(this->proc_or_file); data/grub-customizer-5.1.0/src/Model/Theme.hpp:129:16: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(file)) != EOF) { data/grub-customizer-5.1.0/src/lib/CsvProcessor.hpp:49:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(this->_file)) != EOF) { data/grub-customizer-5.1.0/src/lib/CsvProcessor.hpp:81:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). std::map<std::string, std::string> read() { ANALYSIS SUMMARY: Hits = 99 Lines analyzed = 20319 in approximately 0.67 seconds (30492 lines/second) Physical Source Lines of Code (SLOC) = 14804 Hits@level = [0] 0 [1] 23 [2] 50 [3] 1 [4] 12 [5] 13 Hits@level+ = [0+] 99 [1+] 99 [2+] 76 [3+] 26 [4+] 25 [5+] 13 Hits/KSLOC@level+ = [0+] 6.68738 [1+] 6.68738 [2+] 5.13375 [3+] 1.75628 [4+] 1.68873 [5+] 0.878141 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.