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/lgogdownloader-3.7/include/blacklist.h Examining data/lgogdownloader-3.7/include/config.h Examining data/lgogdownloader-3.7/include/downloader.h Examining data/lgogdownloader-3.7/include/downloadinfo.h Examining data/lgogdownloader-3.7/include/galaxyapi.h Examining data/lgogdownloader-3.7/include/gamedetails.h Examining data/lgogdownloader-3.7/include/gamefile.h Examining data/lgogdownloader-3.7/include/globalconstants.h Examining data/lgogdownloader-3.7/include/globals.h Examining data/lgogdownloader-3.7/include/gui_login.h Examining data/lgogdownloader-3.7/include/message.h Examining data/lgogdownloader-3.7/include/progressbar.h Examining data/lgogdownloader-3.7/include/ssl_thread_setup.h Examining data/lgogdownloader-3.7/include/threadsafequeue.h Examining data/lgogdownloader-3.7/include/util.h Examining data/lgogdownloader-3.7/include/website.h Examining data/lgogdownloader-3.7/include/ziputil.h Examining data/lgogdownloader-3.7/main.cpp Examining data/lgogdownloader-3.7/src/blacklist.cpp Examining data/lgogdownloader-3.7/src/downloader.cpp Examining data/lgogdownloader-3.7/src/galaxyapi.cpp Examining data/lgogdownloader-3.7/src/gamedetails.cpp Examining data/lgogdownloader-3.7/src/gamefile.cpp Examining data/lgogdownloader-3.7/src/gui_login.cpp Examining data/lgogdownloader-3.7/src/progressbar.cpp Examining data/lgogdownloader-3.7/src/util.cpp Examining data/lgogdownloader-3.7/src/website.cpp Examining data/lgogdownloader-3.7/src/ziputil.cpp FINAL RESULTS: data/lgogdownloader-3.7/include/util.h:83:31: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. std::size_t sz = std::snprintf(nullptr, 0, format.c_str(), args ...) + 1; // +1 for null terminator data/lgogdownloader-3.7/include/util.h:85:14: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. std::snprintf(buf.get(), sz, format.c_str(), args ...); data/lgogdownloader-3.7/src/downloader.cpp:1056:20: [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. boost::system::error_code ec; data/lgogdownloader-3.7/src/downloader.cpp:1350:20: [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. boost::system::error_code ec; data/lgogdownloader-3.7/src/downloader.cpp:2728:24: [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. boost::system::error_code ec; data/lgogdownloader-3.7/src/downloader.cpp:4542:20: [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. boost::system::error_code ec; data/lgogdownloader-3.7/src/util.cpp:428:24: [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. boost::system::error_code ec; data/lgogdownloader-3.7/main.cpp:576:27: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *ca_bundle = getenv("CURL_CA_BUNDLE"); data/lgogdownloader-3.7/src/util.cpp:500:25: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. return (std::string)getenv("HOME"); data/lgogdownloader-3.7/src/util.cpp:506:23: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *xdgconfig = getenv("XDG_CONFIG_HOME"); data/lgogdownloader-3.7/src/util.cpp:517:22: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char *xdgcache = getenv("XDG_CACHE_HOME"); data/lgogdownloader-3.7/src/downloader.cpp:65:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&(mem->memory[mem->size]), contents, realsize); data/lgogdownloader-3.7/src/downloader.cpp:229:26: [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). this->report_ofs.open(Globals::globalConfig.sReportFilePath); data/lgogdownloader-3.7/src/downloader.cpp:965: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). if ((outfile=fopen(filepath.c_str(), "r"))!=NULL) data/lgogdownloader-3.7/src/downloader.cpp:1067:30: [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). if ((outfile=fopen(filepath.c_str(), "w"))!=NULL) data/lgogdownloader-3.7/src/downloader.cpp:1083: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). if ((outfile=fopen(filepath.c_str(), "w"))!=NULL) data/lgogdownloader-3.7/src/downloader.cpp:1304: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). if ((outfile = fopen(filepath.c_str(), "r+"))!=NULL ) data/lgogdownloader-3.7/src/downloader.cpp:2797:30: [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). if ((outfile=fopen(filepath.string().c_str(), "r+"))!=NULL) data/lgogdownloader-3.7/src/downloader.cpp:2811:30: [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). if ((outfile=fopen(filepath.string().c_str(), "w"))!=NULL) data/lgogdownloader-3.7/src/downloader.cpp:3744: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* f = fopen(path.string().c_str(), "r"); data/lgogdownloader-3.7/src/downloader.cpp:4485:17: [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). ofs.open(baseFile.first, std::ios_base::binary | std::ios_base::app); data/lgogdownloader-3.7/src/downloader.cpp:4501:21: [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). ofs.open(splitFile.filepath, std::ios_base::binary | std::ios_base::app); data/lgogdownloader-3.7/src/downloader.cpp:4896:38: [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). if ((outfile=fopen(path_tmp.string().c_str(), "r+"))!=NULL) data/lgogdownloader-3.7/src/downloader.cpp:4911:38: [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). if ((outfile=fopen(path_tmp.string().c_str(), "w"))!=NULL) data/lgogdownloader-3.7/src/util.cpp:61:14: [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 digest[rhash_get_digest_size(hash_id)]; data/lgogdownloader-3.7/src/util.cpp:62: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 result[rhash_get_hash_length(hash_id) + 1]; data/lgogdownloader-3.7/src/util.cpp:75: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 result[rhash_get_hash_length(hash_id) + 1]; data/lgogdownloader-3.7/src/util.cpp:100: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 *infile = fopen(filepath.c_str(), "r"); data/lgogdownloader-3.7/src/util.cpp:139:14: [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 digest[rhash_get_digest_size(hash_id)]; data/lgogdownloader-3.7/src/util.cpp:140: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 result[rhash_get_hash_length(hash_id) + 1]; data/lgogdownloader-3.7/src/util.cpp:174: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). if ((infile=fopen(filepath.c_str(), "r"))!=NULL) { data/lgogdownloader-3.7/src/util.cpp:213: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 rhash_result[rhash_get_hash_length(RHASH_MD5) + 1]; data/lgogdownloader-3.7/src/util.cpp:265: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). if ((xmlfile=fopen(filenameXML.c_str(), "w"))!=NULL) { data/lgogdownloader-3.7/src/downloader.cpp:1515:13: [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. usleep(Globals::globalConfig.iWait); // Delay the request by specified time data/lgogdownloader-3.7/src/downloader.cpp:2785:17: [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. usleep(conf.iWait); // Wait before continuing data/lgogdownloader-3.7/src/downloader.cpp:3930:17: [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. usleep(Globals::globalConfig.iWait); // Delay the request by specified time data/lgogdownloader-3.7/src/downloader.cpp:4728:17: [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. usleep(conf.iWait); // Delay the request by specified time data/lgogdownloader-3.7/src/downloader.cpp:4924:25: [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. usleep(conf.iWait); // Delay the request by specified time data/lgogdownloader-3.7/src/galaxyapi.cpp:127:13: [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. usleep(Globals::globalConfig.iWait); // Delay the request by specified time data/lgogdownloader-3.7/src/website.cpp:68:13: [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. usleep(Globals::globalConfig.iWait); // Delay the request by specified time data/lgogdownloader-3.7/src/ziputil.cpp:198:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). stream->read(buf, eocd.comment_length); data/lgogdownloader-3.7/src/ziputil.cpp:318:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). stream->read(buf, cd.filename_length); data/lgogdownloader-3.7/src/ziputil.cpp:324:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). stream->read(buf, cd.extra_length); data/lgogdownloader-3.7/src/ziputil.cpp:471:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). stream->read(buf, cd.comment_length); ANALYSIS SUMMARY: Hits = 44 Lines analyzed = 10784 in approximately 0.31 seconds (34594 lines/second) Physical Source Lines of Code (SLOC) = 8722 Hits@level = [0] 5 [1] 11 [2] 22 [3] 4 [4] 7 [5] 0 Hits@level+ = [0+] 49 [1+] 44 [2+] 33 [3+] 11 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 5.61798 [1+] 5.04471 [2+] 3.78354 [3+] 1.26118 [4+] 0.802568 [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.