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/stormbaancoureur-2.1.6/tools/splitppm.cxx Examining data/stormbaancoureur-2.1.6/tools/mkspot.cxx Examining data/stormbaancoureur-2.1.6/src-common/modelmap.h Examining data/stormbaancoureur-2.1.6/src-common/joydb.h Examining data/stormbaancoureur-2.1.6/src-common/soundenginealsa.h Examining data/stormbaancoureur-2.1.6/src-common/dynamiccapsuleobject.h Examining data/stormbaancoureur-2.1.6/src-common/stereocontext.h Examining data/stormbaancoureur-2.1.6/src-common/staticworldobject.h Examining data/stormbaancoureur-2.1.6/src-common/soundfeed.h Examining data/stormbaancoureur-2.1.6/src-common/brickwall.h Examining data/stormbaancoureur-2.1.6/src-common/soundclip.h Examining data/stormbaancoureur-2.1.6/src-common/dynamicboxobject.h Examining data/stormbaancoureur-2.1.6/src-common/dynamicobject.cxx Examining data/stormbaancoureur-2.1.6/src-common/dynamiccylobject.h Examining data/stormbaancoureur-2.1.6/src-common/soundenginealsa.cxx Examining data/stormbaancoureur-2.1.6/src-common/staticworldobject.cxx Examining data/stormbaancoureur-2.1.6/src-common/usercam.h Examining data/stormbaancoureur-2.1.6/src-common/dynamicobject.h Examining data/stormbaancoureur-2.1.6/src-common/worldobject.h Examining data/stormbaancoureur-2.1.6/src-common/trackingcam.h Examining data/stormbaancoureur-2.1.6/src-common/ogl.cxx Examining data/stormbaancoureur-2.1.6/src-common/ogl.h Examining data/stormbaancoureur-2.1.6/src-common/vectortext.cxx Examining data/stormbaancoureur-2.1.6/src-common/vectortext.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/spikejump.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/intro.cxx Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/postscore.cxx Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/carobject.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/turntable.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/controller.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/ferriswheel.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/controllerpad.cxx Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/postscore.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/cratewall.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/starsky.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/controllerkey.cxx Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/sturmbahn.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/plodegui.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/carobject.cxx Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/intro.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/carpettrack.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/respawnpoint.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/doorstand.h Examining data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx FINAL RESULTS: data/stormbaancoureur-2.1.6/src-stormbaancoureur/controllerkey.cxx:41:16: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. int rv=sscanf(line, "%d %s", &ascii, func); data/stormbaancoureur-2.1.6/src-stormbaancoureur/controllerpad.cxx:58:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errbuf, "%s: Unknown Multimedia system error: 0x%x", data/stormbaancoureur-2.1.6/src-stormbaancoureur/controllerpad.cxx:64:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(errbuf, "%s: %s", function, error); data/stormbaancoureur-2.1.6/src-stormbaancoureur/plodegui.h:61:18: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. int rv=sscanf(leaderboardtext+16*i, "%s %f", name, &tim); data/stormbaancoureur-2.1.6/src-stormbaancoureur/plodegui.h:77:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(line,"%02d %-8s %6.2f", idx+1, leadernames[idx].c_str(), leadertimes[idx]); data/stormbaancoureur-2.1.6/src-stormbaancoureur/postscore.cxx:62:3: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(m, "%-8s %6.2f " VERSION_STRING(GAMEVERSION) , username, tim); data/stormbaancoureur-2.1.6/src-common/modelmap.h:28:32: [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. static bool low_detail = getenv("PLODE_LOW_DETAIL"); data/stormbaancoureur-2.1.6/src-common/ogl.cxx:54:7: [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. if (getenv("PLODE_NO_SHADOWS")) return false; data/stormbaancoureur-2.1.6/src-common/worldobject.h:16: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. static bool disabled = getenv("PLODE_NO_DISPLAY_LISTS"); data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx:853:7: [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. if (getenv("PLODE_DATADIR")) data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx:854:17: [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. dirprefix = getenv("PLODE_DATADIR"); data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx:855:7: [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. if (getenv("PLODE_DISPLAYMODE")) data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx:856:19: [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. displaymode = getenv("PLODE_DISPLAYMODE"); data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx:859:16: [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 *unam = getenv("USER"); data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx:930:16: [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 *ev = getenv("HOME"); data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx:974:18: [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. bool nosound = getenv("PLODE_NO_SOUND"); data/stormbaancoureur-2.1.6/src-stormbaancoureur/postscore.cxx:95:3: [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(0)); data/stormbaancoureur-2.1.6/src-common/ogl.cxx:101: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 log_text[4096]; data/stormbaancoureur-2.1.6/src-common/ogl.cxx:108: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). f = fopen(fname.c_str(),"rb"); assert(f); sz=fread(fragment_program_text, 1, 8192, f); fclose(f); data/stormbaancoureur-2.1.6/src-common/ogl.cxx:122: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). f = fopen(fname.c_str(),"rb"); assert(f); sz=fread(vertex_program_text, 1, 8192, f); fclose(f); data/stormbaancoureur-2.1.6/src-common/soundclip.h:30: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). FILE *f=fopen(nm.c_str(),"rb"); data/stormbaancoureur-2.1.6/src-common/soundfeed.h:164:11: [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(data, clip->data, clip->framecnt*2*sizeof(short)); data/stormbaancoureur-2.1.6/src-common/soundfeed.h:165:11: [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(data+sz*2, clip->data, clip->framecnt*2*sizeof(short)); data/stormbaancoureur-2.1.6/src-common/soundfeed.h:171:11: [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(data+2*delay, clip->data, clip->framecnt*2*sizeof(short)); data/stormbaancoureur-2.1.6/src-common/staticworldobject.cxx:76: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(vertices+3*i, v, 3*sizeof(float)); data/stormbaancoureur-2.1.6/src-stormbaancoureur/controllerkey.cxx:29: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(map_fname.c_str(), "r"); data/stormbaancoureur-2.1.6/src-stormbaancoureur/controllerkey.cxx:33: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 line[256], *s; data/stormbaancoureur-2.1.6/src-stormbaancoureur/controllerkey.cxx:40: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 func[128]; data/stormbaancoureur-2.1.6/src-stormbaancoureur/controllerpad.cxx:32:10: [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. static char errbuf[BUFSIZ]; data/stormbaancoureur-2.1.6/src-stormbaancoureur/controllerpad.cxx:115: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). fd = open(devfile.c_str(), O_RDONLY | O_NONBLOCK); data/stormbaancoureur-2.1.6/src-stormbaancoureur/controllerpad.cxx:143: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 n[128]; data/stormbaancoureur-2.1.6/src-stormbaancoureur/intro.cxx:180: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(fname.c_str(),"r"); data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx:466: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 s[25]; data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx:467: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(s, "%.02f %d FPS", gametime, (int) fps); data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx:526:9: [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). f=fopen("capture.out", "wb"); data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx:534:7: [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(revbuf + y*chunk, buf + (winh - 1 - y)*chunk, chunk); data/stormbaancoureur-2.1.6/src-stormbaancoureur/plodegui.h:59:11: [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 name[16]; data/stormbaancoureur-2.1.6/src-stormbaancoureur/plodegui.h:75: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. static char line[80]; data/stormbaancoureur-2.1.6/src-stormbaancoureur/postscore.cxx:27:8: [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. static char msg[1472]; data/stormbaancoureur-2.1.6/src-stormbaancoureur/postscore.cxx:61: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 m[128]; data/stormbaancoureur-2.1.6/tools/splitppm.cxx:14:11: [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). int w = atoi(argv[2]); data/stormbaancoureur-2.1.6/tools/splitppm.cxx:15:11: [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). int h = atoi(argv[3]); data/stormbaancoureur-2.1.6/tools/splitppm.cxx:17: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(fname,"rb"); data/stormbaancoureur-2.1.6/tools/splitppm.cxx:30:7: [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 outname[128]; data/stormbaancoureur-2.1.6/tools/splitppm.cxx:31:7: [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(outname, "nb%04d.ppm", framenr); data/stormbaancoureur-2.1.6/tools/splitppm.cxx:32: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). FILE *g=fopen(outname,"wb"); data/stormbaancoureur-2.1.6/src-common/ogl.cxx:109:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sz = strlen(fragment_program_text); data/stormbaancoureur-2.1.6/src-common/ogl.cxx:123:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sz = strlen(vertex_program_text); data/stormbaancoureur-2.1.6/src-stormbaancoureur/controllerpad.cxx:240:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). retval = read(fd, &ev, sizeof(ev)); data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx:860:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (unam && strlen(unam)>2) data/stormbaancoureur-2.1.6/src-stormbaancoureur/main.cxx:863:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(unam)>8) data/stormbaancoureur-2.1.6/src-stormbaancoureur/plodegui.h:56:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int numscores = strlen(leaderboardtext) / 16; data/stormbaancoureur-2.1.6/src-stormbaancoureur/plodegui.h:78:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (unsigned int i=0; i<strlen(line); i++) data/stormbaancoureur-2.1.6/src-stormbaancoureur/plodegui.h:152:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). vt_set_pos(44-strlen(fps), 13.5); data/stormbaancoureur-2.1.6/src-stormbaancoureur/postscore.cxx:63:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int rv = sendto(sock, m, strlen(m), 0, (struct sockaddr*) &addr, addrlen); ANALYSIS SUMMARY: Hits = 55 Lines analyzed = 6930 in approximately 0.18 seconds (38200 lines/second) Physical Source Lines of Code (SLOC) = 5699 Hits@level = [0] 64 [1] 9 [2] 29 [3] 11 [4] 6 [5] 0 Hits@level+ = [0+] 119 [1+] 55 [2+] 46 [3+] 17 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 20.8809 [1+] 9.65082 [2+] 8.07159 [3+] 2.98298 [4+] 1.05282 [5+] 0 Symlinks skipped = 4 (--allowlink overrides but see doc for security issue) 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.