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/kball-0.0.20041216/include/backgbmp.h Examining data/kball-0.0.20041216/include/cball.h Examining data/kball-0.0.20041216/include/control.h Examining data/kball-0.0.20041216/include/cwdata.h Examining data/kball-0.0.20041216/include/filehelp.h Examining data/kball-0.0.20041216/include/gamemenu.h Examining data/kball-0.0.20041216/include/gerror.h Examining data/kball-0.0.20041216/include/gkernel.h Examining data/kball-0.0.20041216/include/mapedit.h Examining data/kball-0.0.20041216/include/misc_def.h Examining data/kball-0.0.20041216/include/mytracer.h Examining data/kball-0.0.20041216/include/particle.h Examining data/kball-0.0.20041216/include/partmang.h Examining data/kball-0.0.20041216/include/qmenu.h Examining data/kball-0.0.20041216/include/savescrs.h Examining data/kball-0.0.20041216/include/sphermap.h Examining data/kball-0.0.20041216/include/tmap.h Examining data/kball-0.0.20041216/include/ui_misc.h Examining data/kball-0.0.20041216/include/sound.h Examining data/kball-0.0.20041216/include/musiclvl.h Examining data/kball-0.0.20041216/include/stats.h Examining data/kball-0.0.20041216/include/intro.h Examining data/kball-0.0.20041216/src/backgbmp.cpp Examining data/kball-0.0.20041216/src/cball.cpp Examining data/kball-0.0.20041216/src/control.cpp Examining data/kball-0.0.20041216/src/gerror.cpp Examining data/kball-0.0.20041216/src/mytracer.cpp Examining data/kball-0.0.20041216/src/particle.cpp Examining data/kball-0.0.20041216/src/partmang.cpp Examining data/kball-0.0.20041216/src/savescrs.cpp Examining data/kball-0.0.20041216/src/tmap.cpp Examining data/kball-0.0.20041216/src/ui_misc.cpp Examining data/kball-0.0.20041216/src/sound.cpp Examining data/kball-0.0.20041216/src/stats.cpp Examining data/kball-0.0.20041216/src/musiclvl.cpp Examining data/kball-0.0.20041216/src/intro.cpp Examining data/kball-0.0.20041216/src/main.cpp Examining data/kball-0.0.20041216/src/sphermap.cpp Examining data/kball-0.0.20041216/src/filehelp.cpp Examining data/kball-0.0.20041216/src/gkernel.cpp Examining data/kball-0.0.20041216/src/gamemenu.cpp Examining data/kball-0.0.20041216/src/mapedit.cpp Examining data/kball-0.0.20041216/src/qmenu.cpp Examining data/kball-0.0.20041216/src/cwdata.cpp Examining data/kball-0.0.20041216/test.cpp FINAL RESULTS: data/kball-0.0.20041216/src/mytracer.cpp:48:4: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. vsprintf(buf, msg, ap); // this is ANSI, POSIX, I hope... :O data/kball-0.0.20041216/src/gamemenu.cpp:221: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 str[4096], *home = getenv("HOME"); data/kball-0.0.20041216/src/gamemenu.cpp:317:26: [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 str[4096], *home = getenv("HOME"); data/kball-0.0.20041216/src/gamemenu.cpp:487:9: [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. home = getenv("HOME"); data/kball-0.0.20041216/src/gamemenu.cpp:646:26: [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 str[4096], *home = getenv("HOME"); data/kball-0.0.20041216/src/gamemenu.cpp:714: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 str[4096], *home = getenv("HOME"); data/kball-0.0.20041216/src/gamemenu.cpp:787:10: [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. home = getenv("HOME"); data/kball-0.0.20041216/src/main.cpp:152:2: [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)); // init random numbers data/kball-0.0.20041216/src/mapedit.cpp:173:15: [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 *home = getenv("HOME"); data/kball-0.0.20041216/include/backgbmp.h:34: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 file_loaded[1024]; // wich file we have in memory data/kball-0.0.20041216/include/gkernel.h:80: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 current_level_file_name[1024]; data/kball-0.0.20041216/include/musiclvl.h:29: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 file_loaded[1024]; // wich file we have in memory data/kball-0.0.20041216/include/tmap.h:43: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 spr_name[512]; // this is to keep sprite name, is just to let the thing save itself when needed (as in a map editor) data/kball-0.0.20041216/include/tmap.h:46: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 sound_name[512]; // this is to keep sound name, is just to let the thing save itself when needed (as in a map editor) data/kball-0.0.20041216/src/backgbmp.cpp:31:2: [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[1024]; data/kball-0.0.20041216/src/backgbmp.cpp:33:2: [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 tmp_file_buf[2048]; data/kball-0.0.20041216/src/cball.cpp:456:4: [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 score_txt[256]; data/kball-0.0.20041216/src/control.cpp:200:1: [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[256]; data/kball-0.0.20041216/src/control.cpp:223:1: [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[256]; data/kball-0.0.20041216/src/cwdata.cpp:68:2: [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 tmp_file_buf[2048]; data/kball-0.0.20041216/src/filehelp.cpp:25:1: [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[2048] = "/usr/share/games/kball/", data/kball-0.0.20041216/src/gamemenu.cpp:97: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 tmpstr[256]; data/kball-0.0.20041216/src/gamemenu.cpp:123: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 tbufstr[256]; // time string buffer data/kball-0.0.20041216/src/gamemenu.cpp:155:2: [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 tmp_file_buf[2048]; data/kball-0.0.20041216/src/gamemenu.cpp:221: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 str[4096], *home = getenv("HOME"); data/kball-0.0.20041216/src/gamemenu.cpp:309:2: [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 path_str[2048]; // path to level to play data/kball-0.0.20041216/src/gamemenu.cpp:310:2: [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 level_path[2048]; // full path to levels in general (dir/kball/bin/levels, etc) data/kball-0.0.20041216/src/gamemenu.cpp:317:2: [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[4096], *home = getenv("HOME"); data/kball-0.0.20041216/src/gamemenu.cpp:355: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 t[2048]; data/kball-0.0.20041216/src/gamemenu.cpp:646:2: [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[4096], *home = getenv("HOME"); data/kball-0.0.20041216/src/gamemenu.cpp:708: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 tmpstrvol[256]; data/kball-0.0.20041216/src/gamemenu.cpp:714: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 str[4096], *home = getenv("HOME"); data/kball-0.0.20041216/src/gkernel.cpp:103:2: [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 tmp_file_buf[2048]; data/kball-0.0.20041216/src/gkernel.cpp:375:4: [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 tmp_str[80]; data/kball-0.0.20041216/src/gkernel.cpp:769:2: [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 tmp_str[4096]; // buffer to handle level filenames data/kball-0.0.20041216/src/gkernel.cpp:797:4: [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 tmp_file_buf[2048]; data/kball-0.0.20041216/src/intro.cpp:44:2: [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 tmp_str[2048]; data/kball-0.0.20041216/src/intro.cpp:70:2: [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[1024]; data/kball-0.0.20041216/src/mapedit.cpp:170:2: [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[2048]; data/kball-0.0.20041216/src/mapedit.cpp:176: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 dir[2048]; data/kball-0.0.20041216/src/mapedit.cpp:206:2: [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 tmp_file_buf[2048]; data/kball-0.0.20041216/src/mapedit.cpp:694:4: [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 st1[255], st2[255]; // d_edit_buffers data/kball-0.0.20041216/src/mapedit.cpp:724:10: [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). it1 = atoi(st1); data/kball-0.0.20041216/src/mapedit.cpp:725:10: [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). it2 = atoi(st2); data/kball-0.0.20041216/src/musiclvl.cpp:45:2: [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[1024]; data/kball-0.0.20041216/src/musiclvl.cpp:47:2: [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 tmp_file_buf[2048]; data/kball-0.0.20041216/src/mytracer.cpp:32:7: [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). fp = fopen(TRACE_SAVE_IN_FILE, "a"); data/kball-0.0.20041216/src/mytracer.cpp:43:2: [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[4096]; data/kball-0.0.20041216/src/mytracer.cpp:59:7: [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). fp = fopen(TRACE_SAVE_IN_FILE, "w"); data/kball-0.0.20041216/src/savescrs.cpp:22:2: [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 fname[2048]; data/kball-0.0.20041216/src/tmap.cpp:61:2: [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 str1[2048]; data/kball-0.0.20041216/src/tmap.cpp:93:2: [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 str1[2048]; ANALYSIS SUMMARY: Hits = 52 Lines analyzed = 7278 in approximately 0.21 seconds (34751 lines/second) Physical Source Lines of Code (SLOC) = 4319 Hits@level = [0] 15 [1] 0 [2] 43 [3] 8 [4] 1 [5] 0 Hits@level+ = [0+] 67 [1+] 52 [2+] 52 [3+] 9 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 15.5129 [1+] 12.0398 [2+] 12.0398 [3+] 2.08382 [4+] 0.231535 [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.