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/trophy-2.0.3/src/upgradespanel.cpp Examining data/trophy-2.0.3/src/casoundeffect.cpp Examining data/trophy-2.0.3/src/calabel.h Examining data/trophy-2.0.3/src/caconfigurekey.h Examining data/trophy-2.0.3/src/cacarupgrades.cpp Examining data/trophy-2.0.3/src/cachampionshipscreen.h Examining data/trophy-2.0.3/src/camenuinput.cpp Examining data/trophy-2.0.3/src/caslotselectiondialog.cpp Examining data/trophy-2.0.3/src/canetserver.cpp Examining data/trophy-2.0.3/src/camenuselect.h Examining data/trophy-2.0.3/src/capanel.cpp Examining data/trophy-2.0.3/src/caresources.h Examining data/trophy-2.0.3/src/capositiontableview.cpp Examining data/trophy-2.0.3/src/cainfodialog.cpp Examining data/trophy-2.0.3/src/capositiontable.h Examining data/trophy-2.0.3/src/track.cpp Examining data/trophy-2.0.3/src/computerplayer.cpp Examining data/trophy-2.0.3/src/cachampionshipscreen.cpp Examining data/trophy-2.0.3/src/caimagemanipulation.cpp Examining data/trophy-2.0.3/src/caimagehueselector.cpp Examining data/trophy-2.0.3/src/caloadingscreen.cpp Examining data/trophy-2.0.3/src/caimageselector.cpp Examining data/trophy-2.0.3/src/cafogbomb.h Examining data/trophy-2.0.3/src/camenuitem.h Examining data/trophy-2.0.3/src/caconfigurekey.cpp Examining data/trophy-2.0.3/src/caimageview.cpp Examining data/trophy-2.0.3/src/camenuinput.h Examining data/trophy-2.0.3/src/camenuitem.cpp Examining data/trophy-2.0.3/src/calineedit.h Examining data/trophy-2.0.3/src/camenu.cpp Examining data/trophy-2.0.3/src/upgradespanel.h Examining data/trophy-2.0.3/src/caescapedialog.cpp Examining data/trophy-2.0.3/src/caimageview.h Examining data/trophy-2.0.3/src/cacarupgrades.h Examining data/trophy-2.0.3/src/humanplayer.cpp Examining data/trophy-2.0.3/src/cagoodytype.h Examining data/trophy-2.0.3/src/cagoody.cpp Examining data/trophy-2.0.3/src/catrophy.cpp Examining data/trophy-2.0.3/src/capositiontableview.h Examining data/trophy-2.0.3/src/guibox.h Examining data/trophy-2.0.3/src/cagoody.h Examining data/trophy-2.0.3/src/caimageselector.h Examining data/trophy-2.0.3/src/cadialog.cpp Examining data/trophy-2.0.3/src/cascreen.cpp Examining data/trophy-2.0.3/src/cacredits.cpp Examining data/trophy-2.0.3/src/shopscreen.h Examining data/trophy-2.0.3/src/casignupscreen.h Examining data/trophy-2.0.3/src/cacredits.h Examining data/trophy-2.0.3/src/caplayerview.cpp Examining data/trophy-2.0.3/src/catrophy.h Examining data/trophy-2.0.3/src/shopscreen.cpp Examining data/trophy-2.0.3/src/caplayerview.h Examining data/trophy-2.0.3/src/casoundeffect.h Examining data/trophy-2.0.3/src/computerplayer.h Examining data/trophy-2.0.3/src/windialog.cpp Examining data/trophy-2.0.3/src/caimagehueselector.h Examining data/trophy-2.0.3/src/calabel.cpp Examining data/trophy-2.0.3/src/humanplayer.h Examining data/trophy-2.0.3/src/track.h Examining data/trophy-2.0.3/src/utils/trophymath.cpp Examining data/trophy-2.0.3/src/utils/trophymath.h Examining data/trophy-2.0.3/src/utils/hsvcolor.h Examining data/trophy-2.0.3/src/camenuselect.cpp Examining data/trophy-2.0.3/src/cawidget.cpp Examining data/trophy-2.0.3/src/caplayersettingsdialog.h Examining data/trophy-2.0.3/src/player.cpp Examining data/trophy-2.0.3/src/cartype.cpp Examining data/trophy-2.0.3/src/guibox.cpp Examining data/trophy-2.0.3/src/canetclient.h Examining data/trophy-2.0.3/src/caescapedialog.h Examining data/trophy-2.0.3/src/caloadingscreen.h Examining data/trophy-2.0.3/src/capositiontable.cpp Examining data/trophy-2.0.3/src/cawidget.h Examining data/trophy-2.0.3/src/casignupscreen.cpp Examining data/trophy-2.0.3/src/cainfodialog.h Examining data/trophy-2.0.3/src/cadialog.h Examining data/trophy-2.0.3/src/camenu.h Examining data/trophy-2.0.3/src/canetserver.h Examining data/trophy-2.0.3/src/caslotselectiondialog.h Examining data/trophy-2.0.3/src/capanel.h Examining data/trophy-2.0.3/src/cadustclowd.h Examining data/trophy-2.0.3/src/camenulabel.cpp Examining data/trophy-2.0.3/src/caplayersettingsdialog.cpp Examining data/trophy-2.0.3/src/canetclient.cpp Examining data/trophy-2.0.3/src/cagoodytype.cpp Examining data/trophy-2.0.3/src/windialog.h Examining data/trophy-2.0.3/src/caimagemanipulation.h Examining data/trophy-2.0.3/src/player.h Examining data/trophy-2.0.3/src/cartype.h Examining data/trophy-2.0.3/src/camenulabel.h Examining data/trophy-2.0.3/src/calineedit.cpp Examining data/trophy-2.0.3/src/caresources.cpp Examining data/trophy-2.0.3/src/cascreen.h FINAL RESULTS: data/trophy-2.0.3/src/calineedit.cpp:112:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( dummy, data/trophy-2.0.3/src/calineedit.cpp:124:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( dummy, data/trophy-2.0.3/src/calineedit.cpp:138:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf( dummy, data/trophy-2.0.3/src/catrophy.cpp:149:32: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). if( c<argc-1 ) strcpy( serverIp, argv[c+1] ); data/trophy-2.0.3/src/casignupscreen.cpp:182:17: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (random <= 0) data/trophy-2.0.3/src/casignupscreen.cpp:184:18: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. if (random <= 1) data/trophy-2.0.3/src/catrophy.cpp:199:33: [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. m_homedir = std::string(getenv("HOME")); data/trophy-2.0.3/src/catrophy.cpp:201:33: [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. m_homedir = std::string(getenv("APPDATA")); // For windows data/trophy-2.0.3/src/utils/trophymath.cpp:150:9: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand( time( NULL ) ); data/trophy-2.0.3/src/calabel.cpp:25: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 cStr[2]; data/trophy-2.0.3/src/calineedit.cpp:83: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 dummy[256]; data/trophy-2.0.3/src/camenuinput.cpp:34: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 intStr[16]; data/trophy-2.0.3/src/camenuinput.cpp:35:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( intStr, "%d", *resultInt ); data/trophy-2.0.3/src/camenuinput.cpp:69:30: [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( isInt ) *resultInt = atoi( edit->getText().c_str() ); data/trophy-2.0.3/src/capanel.cpp:74: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 str[16]; data/trophy-2.0.3/src/capanel.cpp:75:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( str, "FPS: %d", fps ); data/trophy-2.0.3/src/catrophy.cpp:73:9: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy( serverIp, "0.0.0.0" ); data/trophy-2.0.3/src/catrophy.h:228: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 serverIp[16]; data/trophy-2.0.3/src/track.cpp:125: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* fp = fopen( "trackdata.txt", "at" ); data/trophy-2.0.3/src/track.cpp:229: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 str[16]; data/trophy-2.0.3/src/track.cpp:234:13: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( str, "%d/%d", r, t ); ANALYSIS SUMMARY: Hits = 21 Lines analyzed = 11785 in approximately 0.25 seconds (46479 lines/second) Physical Source Lines of Code (SLOC) = 7285 Hits@level = [0] 4 [1] 0 [2] 12 [3] 5 [4] 4 [5] 0 Hits@level+ = [0+] 25 [1+] 21 [2+] 21 [3+] 9 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 3.43171 [1+] 2.88264 [2+] 2.88264 [3+] 1.23542 [4+] 0.549073 [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.