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/woff-tools-2009.10.04/woff2sfnt.c Examining data/woff-tools-2009.10.04/sfnt2woff.c Examining data/woff-tools-2009.10.04/woff-private.h Examining data/woff-tools-2009.10.04/woff.h Examining data/woff-tools-2009.10.04/woff.c FINAL RESULTS: data/woff-tools-2009.10.04/sfnt2woff.c:78:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "unable to open file %s", name); data/woff-tools-2009.10.04/sfnt2woff.c:176:3: [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(outName, argv[0]); data/woff-tools-2009.10.04/woff.c:1164:7: [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(f, template, prefix, "unrecognized sfnt version"); data/woff-tools-2009.10.04/woff.c:1167:7: [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(f, template, prefix, "checksum mismatch (corrected)"); data/woff-tools-2009.10.04/woff.c:1170:7: [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(f, template, prefix, "misaligned font table"); data/woff-tools-2009.10.04/woff.c:1173:7: [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(f, template, prefix, "extraneous input data discarded"); data/woff-tools-2009.10.04/woff.c:1176:7: [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(f, template, prefix, "final table not correctly padded"); data/woff-tools-2009.10.04/woff.c:1179:7: [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(f, template, prefix, "digital signature (DSIG) table removed"); data/woff-tools-2009.10.04/woff.c:1211:5: [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(f, template, prefix, msg); data/woff-tools-2009.10.04/woff2sfnt.c:82:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "unable to open file %s", name); data/woff-tools-2009.10.04/sfnt2woff.c:108:17: [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 ((opt = getopt(argc, argv, "v:m:p:h")) != -1) { data/woff-tools-2009.10.04/woff2sfnt.c:110:17: [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 ((opt = getopt(argc, argv, "vmph")) != -1) { data/woff-tools-2009.10.04/sfnt2woff.c:75:19: [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 * inFile = fopen(name, "rb"); data/woff-tools-2009.10.04/sfnt2woff.c:77: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 buf[200]; data/woff-tools-2009.10.04/sfnt2woff.c:173:21: [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 = (char *) malloc(strlen(argv[0]) + 8); data/woff-tools-2009.10.04/sfnt2woff.c:180:3: [2] (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 string. strcat(outName, ".woff"); data/woff-tools-2009.10.04/sfnt2woff.c:183:22: [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 * outFile = fopen(outName, "wb"); data/woff-tools-2009.10.04/woff.c:334: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(woffData + tableOffset, data/woff-tools-2009.10.04/woff.c:501:3: [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(newData, woffData, tableLimit); data/woff-tools-2009.10.04/woff.c:517: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(newData + offset, metaData, metaCompLen); data/woff-tools-2009.10.04/woff.c:527: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(newData + offset, privData, privLen); data/woff-tools-2009.10.04/woff.c:855: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(sfntData + offset, woffData + sourceOffset, origLen); data/woff-tools-2009.10.04/woff.c:1101:3: [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, woffData + offset, length); data/woff-tools-2009.10.04/woff2sfnt.c:79:19: [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 * inFile = fopen(name, "rb"); data/woff-tools-2009.10.04/woff2sfnt.c:81: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 buf[200]; data/woff-tools-2009.10.04/sfnt2woff.c:173:36: [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). char * outName = (char *) malloc(strlen(argv[0]) + 8); ANALYSIS SUMMARY: Hits = 26 Lines analyzed = 1999 in approximately 0.07 seconds (27985 lines/second) Physical Source Lines of Code (SLOC) = 1407 Hits@level = [0] 15 [1] 1 [2] 13 [3] 2 [4] 10 [5] 0 Hits@level+ = [0+] 41 [1+] 26 [2+] 25 [3+] 12 [4+] 10 [5+] 0 Hits/KSLOC@level+ = [0+] 29.14 [1+] 18.479 [2+] 17.7683 [3+] 8.52878 [4+] 7.10732 [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.