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/kxl-1.1.7/src/KXLmisc.c Examining data/kxl-1.1.7/src/KXLimage.c Examining data/kxl-1.1.7/src/KXLsound.c Examining data/kxl-1.1.7/src/KXL.h Examining data/kxl-1.1.7/src/KXLjoystick.c Examining data/kxl-1.1.7/src/KXLvisual.c FINAL RESULTS: data/kxl-1.1.7/src/KXLsound.c:206:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(filename,"%s/%s.wav", path, fname); data/kxl-1.1.7/src/KXLimage.c:108: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). if ((fp = fopen(filename,"rb")) == 0) { data/kxl-1.1.7/src/KXLjoystick.c:20:16: [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). KXL_joydev = open(devname, O_RDONLY); data/kxl-1.1.7/src/KXLsound.c:139: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(KXL_SoundData.FBuff, sample_ptr, sample_size); data/kxl-1.1.7/src/KXLsound.c:143:13: [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(KXL_SoundData.FBuff + sample_size, KXL_SoundData.PlaySound[i].Pos, max_sample_size - sample_size); data/kxl-1.1.7/src/KXLsound.c:207: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). if ((file = fopen(filename,"r")) == NULL) { data/kxl-1.1.7/src/KXLsound.c:253: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). KXL_SoundData.Device = open("/dev/dsp", O_WRONLY|O_NDELAY); data/kxl-1.1.7/src/KXLimage.c:148:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). hed->rgb[i].b = fgetc(fp); data/kxl-1.1.7/src/KXLimage.c:149:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). hed->rgb[i].g = fgetc(fp); data/kxl-1.1.7/src/KXLimage.c:150:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). hed->rgb[i].r = fgetc(fp); data/kxl-1.1.7/src/KXLimage.c:151:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). hed->rgb[i].e = fgetc(fp); data/kxl-1.1.7/src/KXLimage.c:173:16: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). data = fgetc(fp); data/kxl-1.1.7/src/KXLjoystick.c:55:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(KXL_joydev, my, JS_RETURN) == JS_RETURN) { data/kxl-1.1.7/src/KXLsound.c:75:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(KXL_SoundData.Pipe[0], &Command,sizeof(Command)) != sizeof(Command)) data/kxl-1.1.7/src/KXLvisual.c:468:26: [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). x, y, str, strlen(str)); data/kxl-1.1.7/src/KXLvisual.c:478:45: [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). return XTextWidth(KXL_Root->WinFont, str, strlen(str)); ANALYSIS SUMMARY: Hits = 16 Lines analyzed = 1814 in approximately 0.14 seconds (13220 lines/second) Physical Source Lines of Code (SLOC) = 1288 Hits@level = [0] 23 [1] 9 [2] 6 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 39 [1+] 16 [2+] 7 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 30.2795 [1+] 12.4224 [2+] 5.43478 [3+] 0.776398 [4+] 0.776398 [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.