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/mscompress-0.4/src/version.c Examining data/mscompress-0.4/src/msexpand.c Examining data/mscompress-0.4/src/mscompress.c FINAL RESULTS: data/mscompress-0.4/src/mscompress.c:361:7: [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). strcpy (name, argv[0]); data/mscompress-0.4/src/msexpand.c:273:7: [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). strcpy (name, argv[0]); data/mscompress-0.4/src/mscompress.c:320:15: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt (argc, argv, "hV")) != -1) data/mscompress-0.4/src/msexpand.c:229:15: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt (argc, argv, "hV")) != -1) data/mscompress-0.4/src/mscompress.c:158: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 buf[17]; data/mscompress-0.4/src/mscompress.c:316: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 name[0x100]; data/mscompress-0.4/src/mscompress.c:354:12: [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). in = open (argv[0], O_RDONLY); data/mscompress-0.4/src/mscompress.c:364:13: [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). out = open (name, O_WRONLY | O_CREAT | O_EXCL, 0644); data/mscompress-0.4/src/msexpand.c:225: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 name[0x100]; data/mscompress-0.4/src/msexpand.c:266:12: [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). in = open (argv[0], O_RDONLY); data/mscompress-0.4/src/msexpand.c:276:13: [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). out = open (name, O_WRONLY | O_CREAT | O_EXCL, 0644); data/mscompress-0.4/src/mscompress.c:149:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (f, &b, sizeof (b)) != 1) data/mscompress-0.4/src/mscompress.c:346:19: [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 (argv[0][strlen (argv[0]) - 1] == '_') data/mscompress-0.4/src/mscompress.c:362:7: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat (name, "_"); data/mscompress-0.4/src/msexpand.c:45:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (f, &b, sizeof (b)) != 1) data/mscompress-0.4/src/msexpand.c:62:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (in, &magic1, sizeof (magic1)) != sizeof (magic1)) data/mscompress-0.4/src/msexpand.c:74:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (in, &magic2, sizeof (magic2)) != sizeof (magic2)) data/mscompress-0.4/src/msexpand.c:80:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (in, &reserved, sizeof (reserved)) != sizeof (reserved)) data/mscompress-0.4/src/msexpand.c:86:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (in, &filesize, sizeof (filesize)) != sizeof (filesize)) data/mscompress-0.4/src/msexpand.c:108:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (in, &magic2, sizeof (magic2)) != sizeof (magic2)) data/mscompress-0.4/src/msexpand.c:114:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (in, &magic3, sizeof (magic3)) != sizeof (magic3)) data/mscompress-0.4/src/msexpand.c:120:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (in, &reserved, sizeof (reserved)) != sizeof (reserved)) data/mscompress-0.4/src/msexpand.c:258:19: [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 (argv[0][strlen (argv[0]) - 1] != '_') data/mscompress-0.4/src/msexpand.c:274:12: [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). name[strlen (name) - 1] = 0; ANALYSIS SUMMARY: Hits = 24 Lines analyzed = 673 in approximately 0.03 seconds (25968 lines/second) Physical Source Lines of Code (SLOC) = 554 Hits@level = [0] 13 [1] 13 [2] 7 [3] 2 [4] 2 [5] 0 Hits@level+ = [0+] 37 [1+] 24 [2+] 11 [3+] 4 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 66.787 [1+] 43.3213 [2+] 19.8556 [3+] 7.22022 [4+] 3.61011 [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.