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/lintex-1.14/cxx/cleandir.cxx Examining data/lintex-1.14/cxx/cleanup.cxx Examining data/lintex-1.14/cxx/file.cxx Examining data/lintex-1.14/cxx/ltx.cxx Examining data/lintex-1.14/lintex.c FINAL RESULTS: data/lintex-1.14/cxx/cleandir.cxx:128:12: [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). std::strcpy(tName, fullName.c_str()); data/lintex-1.14/cxx/cleandir.cxx:129:12: [4] (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). std::strcat(tName, pDe->d_name); data/lintex-1.14/lintex.c:307:9: [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(bExt, *argv); data/lintex-1.14/lintex.c:390:5: [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(cfg_file, getenv("HOME")); data/lintex-1.14/lintex.c:396:9: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (! access(cfg_file, R_OK)) { data/lintex-1.14/lintex.c:458:11: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (! access(cfg_file, F_OK)) { data/lintex-1.14/lintex.c:497:5: [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(pFN->name, name); data/lintex-1.14/lintex.c:609:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tName, "%s/%s", dirName, pDe->d_name); data/lintex-1.14/lintex.c:696:64: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. insertNode(pDe->d_name, nameLen, sStat.st_mtime, access(tName, W_OK), pTT); data/lintex-1.14/lintex.c:788:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tName, "%s/%s.tex", dirName, pTeX->name); data/lintex-1.14/lintex.c:802:11: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cName, "%s/%s%s", dirName, pTeX->name, pTT->extension); data/lintex-1.14/lintex.c:847:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(cName, "%s/%s%s", dirName, pComp->name, pTT->extension); data/lintex-1.14/cxx/ltx.cxx:72:15: [3] (buffer) getopt_long: 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_long(argc, argv, shortOpts, longOpts, 0)) != -1) { data/lintex-1.14/lintex.c:387:19: [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. needed = strlen(getenv("HOME")) + strlen("/.lintexrc") + 1; data/lintex-1.14/lintex.c:389:7: [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. if (getenv("HOME")) { data/lintex-1.14/lintex.c:390: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. strcpy(cfg_file, getenv("HOME")); data/lintex-1.14/cxx/cleandir.cxx:127:7: [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 tName[filename_max]; data/lintex-1.14/cxx/cleanup.cxx:52: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. char answer[answerLength], c; data/lintex-1.14/lintex.c:153: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[1]; data/lintex-1.14/lintex.c:185: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 bExt[MAX_B_EXT] = "~"; data/lintex-1.14/lintex.c:391:5: [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(cfg_file, "/.lintexrc"); data/lintex-1.14/lintex.c:415: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(protoTreeTemp, protoTree, sizeof(Froot) * protoTreeSize); data/lintex-1.14/lintex.c:589: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(teXTree, protoTree, protoTreeSize * sizeof(Froot)); data/lintex-1.14/lintex.c:592: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 tName[FILENAME_MAX]; /* Fully qualified file name */ data/lintex-1.14/lintex.c:786: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 tName[FILENAME_MAX]; data/lintex-1.14/lintex.c:799:9: [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 cName[FILENAME_MAX]; data/lintex-1.14/lintex.c:845:9: [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 cName[FILENAME_MAX]; data/lintex-1.14/lintex.c:912: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 yn[LONG_ENOUGH], c; data/lintex-1.14/lintex.c:318: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). n_bExt = strlen(bExt); data/lintex-1.14/lintex.c:387: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). needed = strlen(getenv("HOME")) + strlen("/.lintexrc") + 1; data/lintex-1.14/lintex.c:387:37: [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). needed = strlen(getenv("HOME")) + strlen("/.lintexrc") + 1; data/lintex-1.14/lintex.c:487:41: [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). sSize = sizeof(Fnode) + (lName == 0 ? strlen(name) : lName); data/lintex-1.14/lintex.c:499:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(pFN->name, name, lName); data/lintex-1.14/lintex.c:611: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). len = strlen(pDe->d_name); ANALYSIS SUMMARY: Hits = 34 Lines analyzed = 1553 in approximately 0.27 seconds (5844 lines/second) Physical Source Lines of Code (SLOC) = 947 Hits@level = [0] 40 [1] 6 [2] 12 [3] 4 [4] 12 [5] 0 Hits@level+ = [0+] 74 [1+] 34 [2+] 28 [3+] 16 [4+] 12 [5+] 0 Hits/KSLOC@level+ = [0+] 78.1415 [1+] 35.9029 [2+] 29.5671 [3+] 16.8955 [4+] 12.6716 [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.