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/libfontenc-1.1.4/include/X11/fonts/fontenc.h Examining data/libfontenc-1.1.4/src/fontenc.c Examining data/libfontenc-1.1.4/src/encparse.c Examining data/libfontenc-1.1.4/src/fontencI.h FINAL RESULTS: data/libfontenc-1.1.4/src/encparse.c:903:17: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. count = fscanf(file, format, encoding_name, file_name); data/libfontenc-1.1.4/src/encparse.c:836:25: [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. const char *c = getenv("FONT_ENCODINGS_DIRECTORY"); data/libfontenc-1.1.4/src/encparse.c:74:8: [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 char keyword_value[MAXKEYWORDLEN + 1]; data/libfontenc-1.1.4/src/encparse.c:508: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 *aliases[MAXALIASES] = { NULL }; data/libfontenc-1.1.4/src/encparse.c:879: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 file_name[MAXFONTFILENAMELEN], encoding_name[MAXFONTNAMELEN], data/libfontenc-1.1.4/src/encparse.c:882: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. static char format[24] = ""; data/libfontenc-1.1.4/src/encparse.c:887:17: [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(dirname, "r")) == NULL) { data/libfontenc-1.1.4/src/encparse.c:943: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 dir[MAXFONTFILENAMELEN], dirname[MAXFONTFILENAMELEN]; data/libfontenc-1.1.4/src/fontenc.c:581:8: [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 char *iso8859_15_aliases[2] = { "fcd8859-15", NULL }; data/libfontenc-1.1.4/src/fontenc.c:637: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. static char charset[MAXFONTNAMELEN]; data/libfontenc-1.1.4/src/fontenc.c:662: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(charset, p + 1, len); data/libfontenc-1.1.4/src/fontenc.c:817:17: [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(new_aliases, encoding->aliases, data/libfontenc-1.1.4/src/encparse.c:867:16: [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 (buf && strlen(dir) + 14 < MAXFONTFILENAMELEN) { data/libfontenc-1.1.4/src/encparse.c:912:21: [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 (strlen(dir) + strlen(file_name) >= MAXFONTFILENAMELEN) { data/libfontenc-1.1.4/src/encparse.c:912:35: [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 (strlen(dir) + strlen(file_name) >= MAXFONTFILENAMELEN) { ANALYSIS SUMMARY: Hits = 15 Lines analyzed = 2161 in approximately 0.13 seconds (16935 lines/second) Physical Source Lines of Code (SLOC) = 1713 Hits@level = [0] 5 [1] 3 [2] 10 [3] 1 [4] 1 [5] 0 Hits@level+ = [0+] 20 [1+] 15 [2+] 12 [3+] 2 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 11.6754 [1+] 8.75657 [2+] 7.00525 [3+] 1.16754 [4+] 0.583771 [5+] 0 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.