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/opencfu-4.0.0/src/classifier/headers/DataMaker.hpp Examining data/opencfu-4.0.0/src/classifier/main.cpp Examining data/opencfu-4.0.0/src/classifier/src/DataMaker.cpp Examining data/opencfu-4.0.0/src/defines.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ColourCluster.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ColourSelector.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ColourWheel.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ConfigIO.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ControlPanel.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_Decorator.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_Display.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_DisplayBaseClass.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_DisplayRoi.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_HelloWindow.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ImgFileSetter.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_LikFiltSelector.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_MaskSetter.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_MouseHandler.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_MyApplication.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_MyWindow.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_OptionSetterBaseClass.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_PixbufOpener.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ProcessorHandler.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_RadiusSetter.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ResultDetails.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ResultDisplayBaseClass.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ResultFileWriter.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ResultFrame.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ResultLabel.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ResultListDisplay.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_ThresholdSetter.hpp Examining data/opencfu-4.0.0/src/gui/headers/Gui_UserFilterSetter.hpp Examining data/opencfu-4.0.0/src/gui/headers/ResultMap.hpp Examining data/opencfu-4.0.0/src/gui/headers/text.hpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ColourCluster.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ColourSelector.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ColourWheel.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ConfigIO.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ControlPanel.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_Decorator.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_Display.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_DisplayBaseClass.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_DisplayRoi.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_HelloWindow.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ImgFileSetter.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_LikFiltSelector.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_MaskSetter.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_MouseHandler.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_MyApplication.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_MyWindow.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_OptionSetterBaseClass.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_PixbufOpener.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ProcessorHandler.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_RadiusSetter.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ResultDetails.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ResultDisplayBaseClass.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ResultFileWriter.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ResultFrame.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ResultLabel.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ResultListDisplay.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_ThresholdSetter.cpp Examining data/opencfu-4.0.0/src/gui/src/Gui_UserFilterSetter.cpp Examining data/opencfu-4.0.0/src/gui/src/ResultMap.cpp Examining data/opencfu-4.0.0/src/main.cpp Examining data/opencfu-4.0.0/src/processor/headers/ArgumentParser.hpp Examining data/opencfu-4.0.0/src/processor/headers/ContourFamily.hpp Examining data/opencfu-4.0.0/src/processor/headers/ContourSpliter.hpp Examining data/opencfu-4.0.0/src/processor/headers/Features.hpp Examining data/opencfu-4.0.0/src/processor/headers/MaskROI.hpp Examining data/opencfu-4.0.0/src/processor/headers/Predictor.hpp Examining data/opencfu-4.0.0/src/processor/headers/ProcessingOptions.hpp Examining data/opencfu-4.0.0/src/processor/headers/Processor.hpp Examining data/opencfu-4.0.0/src/processor/headers/Result.hpp Examining data/opencfu-4.0.0/src/processor/headers/Step_1.hpp Examining data/opencfu-4.0.0/src/processor/headers/Step_2.hpp Examining data/opencfu-4.0.0/src/processor/headers/Step_3.hpp Examining data/opencfu-4.0.0/src/processor/headers/Step_4.hpp Examining data/opencfu-4.0.0/src/processor/headers/Step_BaseClass.hpp Examining data/opencfu-4.0.0/src/processor/headers/Step_ColourCluster.hpp Examining data/opencfu-4.0.0/src/processor/headers/Step_FiltGUI.hpp Examining data/opencfu-4.0.0/src/processor/headers/Step_FiltHS.hpp Examining data/opencfu-4.0.0/src/processor/headers/Step_FiltIPosition2D.hpp Examining data/opencfu-4.0.0/src/processor/headers/Step_FiltLik.hpp Examining data/opencfu-4.0.0/src/processor/src/ArgumentParser.cpp Examining data/opencfu-4.0.0/src/processor/src/ContourFamily.cpp Examining data/opencfu-4.0.0/src/processor/src/ContourSpliter.cpp Examining data/opencfu-4.0.0/src/processor/src/Features.cpp Examining data/opencfu-4.0.0/src/processor/src/MaskROI.cpp Examining data/opencfu-4.0.0/src/processor/src/Predictor.cpp Examining data/opencfu-4.0.0/src/processor/src/ProcessingOptions.cpp Examining data/opencfu-4.0.0/src/processor/src/Processor.cpp Examining data/opencfu-4.0.0/src/processor/src/Result.cpp Examining data/opencfu-4.0.0/src/processor/src/Step_1.cpp Examining data/opencfu-4.0.0/src/processor/src/Step_2.cpp Examining data/opencfu-4.0.0/src/processor/src/Step_3.cpp Examining data/opencfu-4.0.0/src/processor/src/Step_4.cpp Examining data/opencfu-4.0.0/src/processor/src/Step_BaseClass.cpp Examining data/opencfu-4.0.0/src/processor/src/Step_ColourCluster.cpp Examining data/opencfu-4.0.0/src/processor/src/Step_FiltGUI.cpp Examining data/opencfu-4.0.0/src/processor/src/Step_FiltHS.cpp Examining data/opencfu-4.0.0/src/processor/src/Step_FiltIPosition2D.cpp Examining data/opencfu-4.0.0/src/processor/src/Step_FiltLik.cpp FINAL RESULTS: data/opencfu-4.0.0/src/gui/headers/Gui_HelloWindow.hpp:30:17: [4] (shell) ShellExecute: 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. ShellExecute(NULL, "open", this->get_uri().c_str(), NULL, NULL, SW_SHOWNORMAL); data/opencfu-4.0.0/src/processor/src/ArgumentParser.cpp:36:18: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ( (c = getopt (argc, argv, "hvad:i:m:r:R:c:C:t:l:o:G:N:")) != -1){ data/opencfu-4.0.0/src/classifier/main.cpp:72:9: [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 revLut[3] = {'N','S','M'}; data/opencfu-4.0.0/src/gui/src/ResultMap.cpp:22:9: [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 buf[80]; data/opencfu-4.0.0/src/processor/src/ArgumentParser.cpp:52:39: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). min_max_radius.first =atoi(optarg); data/opencfu-4.0.0/src/processor/src/ArgumentParser.cpp:57:41: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). min_max_radius.second = atoi(optarg); data/opencfu-4.0.0/src/processor/src/ArgumentParser.cpp:62:38: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). cent_tol_hue.first = atoi(optarg); data/opencfu-4.0.0/src/processor/src/ArgumentParser.cpp:67:39: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). cent_tol_hue.second = atoi(optarg); data/opencfu-4.0.0/src/processor/src/ArgumentParser.cpp:71:39: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). clustering_distance = atoi(optarg); data/opencfu-4.0.0/src/processor/src/ArgumentParser.cpp:75:41: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). clustering_neighbours = atoi(optarg); data/opencfu-4.0.0/src/processor/src/ArgumentParser.cpp:112:35: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if (!opts.setThr(atoi(optarg))){ data/opencfu-4.0.0/src/processor/src/ArgumentParser.cpp:113:32: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). std::cerr<<atoi(optarg)<<"Incorrect value for threshold.\ data/opencfu-4.0.0/src/processor/src/Processor.cpp:21:8: [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). fs.open(path, cv::FileStorage::READ); data/opencfu-4.0.0/src/processor/src/Processor.cpp:31: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). fs.open(path, cv::FileStorage::READ); data/opencfu-4.0.0/src/processor/src/Processor.cpp:39:8: [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). fs.open(path_ps, cv::FileStorage::READ); data/opencfu-4.0.0/src/processor/src/Processor.cpp:49: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). fs.open(path_ps, cv::FileStorage::READ); data/opencfu-4.0.0/src/gui/headers/ResultMap.hpp:20:27: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. return file1->equal(file2); data/opencfu-4.0.0/src/gui/src/Gui_ImgFileSetter.cpp:153:20: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if(mf->equal(f)) data/opencfu-4.0.0/src/gui/src/Gui_ProcessorHandler.cpp:50:19: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. Glib::usleep(us_to_sleep); data/opencfu-4.0.0/src/gui/src/Gui_ProcessorHandler.cpp:60:15: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. Glib::usleep(us_to_sleep); data/opencfu-4.0.0/src/gui/src/Gui_ResultDetails.cpp:144:39: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if( N == children.size() && file->equal(m_old_file)){ data/opencfu-4.0.0/src/gui/src/Gui_ResultLabel.cpp:93:20: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. if( !file->equal(m_last_file)){ ANALYSIS SUMMARY: Hits = 22 Lines analyzed = 8964 in approximately 0.32 seconds (28456 lines/second) Physical Source Lines of Code (SLOC) = 6740 Hits@level = [0] 0 [1] 6 [2] 14 [3] 1 [4] 1 [5] 0 Hits@level+ = [0+] 22 [1+] 22 [2+] 16 [3+] 2 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 3.26409 [1+] 3.26409 [2+] 2.37389 [3+] 0.296736 [4+] 0.148368 [5+] 0 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.