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/pngphoon-1.2/moon.h Examining data/pngphoon-1.2/main.c Examining data/pngphoon-1.2/phase.h Examining data/pngphoon-1.2/stars.h Examining data/pngphoon-1.2/image.c Examining data/pngphoon-1.2/tws.c Examining data/pngphoon-1.2/tws.h Examining data/pngphoon-1.2/pngwrite.c Examining data/pngphoon-1.2/moondata.h Examining data/pngphoon-1.2/phase.c Examining data/pngphoon-1.2/stars.c Examining data/pngphoon-1.2/image.h Examining data/pngphoon-1.2/fail.c Examining data/pngphoon-1.2/moon.c Examining data/pngphoon-1.2/pngwrite.h Examining data/pngphoon-1.2/fail.h FINAL RESULTS: data/pngphoon-1.2/fail.c:14:4: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf( stderr, s, args ); data/pngphoon-1.2/fail.c:28:4: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf( stderr, s, args ); data/pngphoon-1.2/main.c:60:16: [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, "w:h:x:y:s:f:bq")) != EOF) data/pngphoon-1.2/stars.c:79:4: [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( image->width * image->height ); data/pngphoon-1.2/tws.c:46:22: [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 *phoontime = getenv( "PHOONTIME" ); data/pngphoon-1.2/moon.c:10:23: [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 const unsigned char leftmask[8] = { 0xff, 0x7f, 0x3f, 0x1f, 0x0f, 0x07, 0x03, 0x01 }; data/pngphoon-1.2/moon.c:11:23: [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 const unsigned char rightmask[8] = { 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe }; data/pngphoon-1.2/moon.c:13:23: [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 const unsigned char shades[16][8] = data/pngphoon-1.2/pngwrite.c:23:12: [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(filename, "wb"); data/pngphoon-1.2/stars.c:15:13: [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. unsigned char data[5]; data/pngphoon-1.2/stars.c:41:16: [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. unsigned char u8[2]; ANALYSIS SUMMARY: Hits = 11 Lines analyzed = 5845 in approximately 0.55 seconds (10568 lines/second) Physical Source Lines of Code (SLOC) = 5533 Hits@level = [0] 1 [1] 0 [2] 6 [3] 3 [4] 2 [5] 0 Hits@level+ = [0+] 12 [1+] 11 [2+] 11 [3+] 5 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 2.16881 [1+] 1.98807 [2+] 1.98807 [3+] 0.903669 [4+] 0.361468 [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.