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/postgresql-q3c-2.0.0/common.h Examining data/postgresql-q3c-2.0.0/my_bits.h Examining data/postgresql-q3c-2.0.0/prepare.c Examining data/postgresql-q3c-2.0.0/q3c.c Examining data/postgresql-q3c-2.0.0/q3c_poly.c Examining data/postgresql-q3c-2.0.0/q3cube.c Examining data/postgresql-q3c-2.0.0/debian/patches/gen_data-no-postgres.h Examining data/postgresql-q3c-2.0.0/gen_data.c FINAL RESULTS: data/postgresql-q3c-2.0.0/q3cube.c:2971:4: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stdout,Q3C_COORD_FMT" "Q3C_COORD_FMT" "Q3C_COORD_FMT" "Q3C_COORD_FMT" "Q3C_COORD_FMT" "Q3C_COORD_FMT"\n", axx,ayy,axy,ax,ay,a); data/postgresql-q3c-2.0.0/common.h:326:12: [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 *too_large, data/postgresql-q3c-2.0.0/gen_data.c:74:16: [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). rand_state = atoi(argv[1]); data/postgresql-q3c-2.0.0/gen_data.c:76:13: [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). npoints = atoi(argv[2]); data/postgresql-q3c-2.0.0/q3c.c:980: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 faces[6]; data/postgresql-q3c-2.0.0/q3c_poly.c:347:36: [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 *too_large, data/postgresql-q3c-2.0.0/q3cube.c:1314: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 *fp = fopen(filename, "w"); data/postgresql-q3c-2.0.0/q3cube.c:2357:4: [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(work_stack + (*work_nstack - tmp_stack1), data/postgresql-q3c-2.0.0/q3cube.c:2364:4: [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(work_stack + (*work_nstack - tmp_stack1), data/postgresql-q3c-2.0.0/q3cube.c:128:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(out,__q3c_version,maxchar); ANALYSIS SUMMARY: Hits = 10 Lines analyzed = 5394 in approximately 0.15 seconds (35865 lines/second) Physical Source Lines of Code (SLOC) = 3931 Hits@level = [0] 62 [1] 1 [2] 8 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 72 [1+] 10 [2+] 9 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 18.316 [1+] 2.54388 [2+] 2.28949 [3+] 0.254388 [4+] 0.254388 [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.