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/lgrind-3.67/example/egcprog.c Examining data/lgrind-3.67/source/lgrind.c Examining data/lgrind-3.67/source/lgrindef.c Examining data/lgrind-3.67/source/lgrindef.h Examining data/lgrind-3.67/source/regexp.c Examining data/lgrind-3.67/source/regexp.h Examining data/lgrind-3.67/source/retest.c Examining data/lgrind-3.67/source/v2lg.c Examining data/lgrind-3.67/source/lgutil.c FINAL RESULTS: data/lgrind-3.67/source/lgrind.c:277:21: [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). if (programname) strcpy(defsfile, programname); data/lgrind-3.67/source/lgrind.c:402:4: [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(language, argv[1]); data/lgrind-3.67/source/lgrind.c:406:4: [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(language, argv[0]+2); data/lgrind-3.67/source/lgrind.c:420: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(defsfile, argv[1]); data/lgrind-3.67/source/lgrind.c:440: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(fname, argv[0]); data/lgrind-3.67/source/lgrind.c:581:6: [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(language, cp); data/lgrind-3.67/source/lgrind.c:616:11: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. fp = popen(cp, "r"); data/lgrind-3.67/source/lgrind.c:619:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(temp, "%%%c on `%s' failed", source, cp); data/lgrind-3.67/source/lgrind.c:622:6: [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(temp, cp); data/lgrind-3.67/source/lgrind.c:632:24: [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). linenobak=lineno; strcpy(fnamebak, fname); data/lgrind-3.67/source/lgrind.c:633:16: [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). lineno=0; strcpy(fname, temp); data/lgrind-3.67/source/lgrind.c:636:24: [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). lineno=linenobak; strcpy(fname, fnamebak); data/lgrind-3.67/source/lgrind.c:779:22: [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). if (cp != NULL) strcpy(language, cp); data/lgrind-3.67/source/lgrind.c:836:6: [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(l_id, cp); data/lgrind-3.67/source/lgrind.c:938:25: [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). if (s1!=pname) strcpy(pname, s1+1); data/lgrind-3.67/source/lgrind.c:941:10: [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(pname, pname+strlen(pname)-28); data/lgrind-3.67/source/lgrind.c:1725:10: [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(++ap, 2) == 0) { data/lgrind-3.67/source/lgrindef.c:95:4: [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(tcname,p+3); data/lgrind-3.67/source/lgrindef.c:113:4: [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(p, q+1); data/lgrind-3.67/source/lgutil.c:78:4: [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((**into).alternatives, alts); data/lgrind-3.67/source/lgutil.c:80:4: [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). strcat((**into).alternatives, token); data/lgrind-3.67/source/retest.c:32:7: [4] (buffer) scanf: 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. scanf ("%s", reg); data/lgrind-3.67/source/lgrind.c:276:16: [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. programname=getenv("LGRINDEF"); data/lgrind-3.67/source/lgrind.c:192:1: [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 pstack[PSMAX][PNAMELEN+1]; /* the procedure name stack */ data/lgrind-3.67/source/lgrind.c:197:1: [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 fname[200]=""; /* File being read */ data/lgrind-3.67/source/lgrind.c:200:1: [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 pname[BUFFERSIZE+1]; /* Current procedure name */ data/lgrind-3.67/source/lgrind.c:205:1: [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 defsbuf[200]="DeFsBuF"DEFSFILE; data/lgrind-3.67/source/lgrind.c:207:1: [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 language[PNAMELEN]="mPi"; /* the language indicator */ data/lgrind-3.67/source/lgrind.c:208:1: [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 the_buf[BUFFERSIZE+1]; /* general purpose buffer */ data/lgrind-3.67/source/lgrind.c:212:1: [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 preamble[BUFFERSIZE/4]; /* first preamble */ data/lgrind-3.67/source/lgrind.c:213:1: [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 postamble[BUFFERSIZE/4]; /* first preamble */ data/lgrind-3.67/source/lgrind.c:214:1: [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 preamble2[BUFFERSIZE/4]; /* file preamble */ data/lgrind-3.67/source/lgrind.c:215:1: [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 config[BUFFERSIZE/4]; /* redefinitions within lgrind-environment */ data/lgrind-3.67/source/lgrind.c:216:1: [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 chartab[BUFFERSIZE/4]; /* buffer for chartab modifications */ data/lgrind-3.67/source/lgrind.c:217:1: [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 *l_keywds[BUFFERSIZE/2]; /* keyword table address */ data/lgrind-3.67/source/lgrind.c:231:1: [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 s_cdebeg[BUFFERSIZE/8]; /* actual string corresponding to @l_cdebeg@ */ data/lgrind-3.67/source/lgrind.c:505:8: [2] (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). Risk is low because the source is a constant string. strcpy(fname, "stdin"); data/lgrind-3.67/source/lgrind.c:553:4: [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 temp[BUFFERSIZE]; data/lgrind-3.67/source/lgrind.c:554:4: [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 fnamebak[200]; data/lgrind-3.67/source/lgrind.c:614:11: [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(cp, "r"); data/lgrind-3.67/source/lgrind.c:860:4: [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 texline[BUFFERSIZE/8]; data/lgrind-3.67/source/lgrind.c:1475:1: [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 *printtab[256] = { data/lgrind-3.67/source/lgrind.c:1510:1: [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 *ttprinttab[256] = { data/lgrind-3.67/source/lgrind.c:1626:4: [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 cheat[BUFFERSIZE]; data/lgrind-3.67/source/lgrindef.c:79:4: [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 tcname[16]; /* name of similar terminal */ data/lgrind-3.67/source/lgrindef.c:80:4: [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 tcbuf[BUFFERSIZE]; data/lgrind-3.67/source/lgrindef.c:286:4: [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 ibuf[BUFFERSIZE]; data/lgrind-3.67/source/lgrindef.c:292:9: [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). tf = fopen(filename, "rt"); data/lgrind-3.67/source/lgutil.c:79:4: [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((**into).alternatives, ", "); data/lgrind-3.67/source/lgutil.c:101:7: [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). tf = fopen(defsfile, "rt"); data/lgrind-3.67/source/lgutil.c:197:5: [2] (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). Risk is low because the source is a constant string. strcpy(preamble, data/lgrind-3.67/source/lgutil.c:203:5: [2] (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). Risk is low because the source is a constant string. strcpy(postamble, "\\end{document}\n"); data/lgrind-3.67/source/lgutil.c:204:5: [2] (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). Risk is low because the source is a constant string. strcpy(preamble2, data/lgrind-3.67/source/lgutil.c:242:11: [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). progfile=fopen(progname, "rb"); data/lgrind-3.67/source/lgutil.c:243:10: [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). newfile=fopen("lgrind.new", "wb"); data/lgrind-3.67/source/lgutil.c:259: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(i+7, newdefsfile, strlen(newdefsfile)+1); data/lgrind-3.67/source/lgutil.c:262: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(buffer, buffer+29500, 200); data/lgrind-3.67/source/lgutil.c:276: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). FILE *f = fopen(fname, "rt"); data/lgrind-3.67/source/lgutil.c:277: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 linebuf[201], *cp; data/lgrind-3.67/source/retest.c:23:4: [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 reg[132]; data/lgrind-3.67/source/retest.c:25:4: [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 str[132]; data/lgrind-3.67/source/retest.c:27:4: [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 matstr[132]; data/lgrind-3.67/source/v2lg.c:26:4: [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 in[256], out[256], *ic, *oc, *verb, delim; data/lgrind-3.67/source/lgrind.c:401:11: [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(argv[0])==2) { data/lgrind-3.67/source/lgrind.c:558:17: [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). cp = &buf[strlen(buf)-1]; data/lgrind-3.67/source/lgrind.c:579:9: [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). cp[strlen(cp) - 1] = '\0'; /* nuke the @'\n'@ */ data/lgrind-3.67/source/lgrind.c:612: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). cp[strlen(cp) - 1] = '\0'; /* nuke the @'\n'@ */ data/lgrind-3.67/source/lgrind.c:663:13: [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). buf[strlen(buf)-1] = '\0'; data/lgrind-3.67/source/lgrind.c:681:30: [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). atptr = atendptr = cp + strlen(cp) - 1; data/lgrind-3.67/source/lgrind.c:682:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(temp, cp, (size_t)(atptr-cp)); data/lgrind-3.67/source/lgrind.c:771:17: [1] (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). Risk is low because the source is a constant character. if (i == 0) strcpy(language, "c"); data/lgrind-3.67/source/lgrind.c:780:11: [1] (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). Risk is low because the source is a constant character. else strcpy(language, "c"); data/lgrind-3.67/source/lgrind.c:835:27: [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). l_id = (char*)malloc(strlen(cp)); data/lgrind-3.67/source/lgrind.c:864:8: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(texline, stringstart, texptr-stringstart); data/lgrind-3.67/source/lgrind.c:934:11: [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(pname)>30) data/lgrind-3.67/source/lgrind.c:936:19: [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). s1=pname+strlen(pname)-1; data/lgrind-3.67/source/lgrind.c:940:11: [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(pname)>32) { data/lgrind-3.67/source/lgrind.c:941:30: [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). strcpy(pname, pname+strlen(pname)-28); data/lgrind-3.67/source/lgrind.c:947:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(pstack[psptr], pname, PNAMELEN); data/lgrind-3.67/source/lgrind.c:995:33: [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). putKcp(s_cdebeg, s_cdebeg + strlen(s_cdebeg) - 1, TRUE); data/lgrind-3.67/source/lgrind.c:1026: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). putKcp(s_cdebeg, s_cdebeg + strlen(s_cdebeg) - 1, TRUE); data/lgrind-3.67/source/lgrind.c:1039:14: [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). s += strlen(s); data/lgrind-3.67/source/lgrind.c:1192:10: [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). s += strlen(s); data/lgrind-3.67/source/lgrind.c:1214:10: [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). s += strlen(s); data/lgrind-3.67/source/lgrind.c:1230:10: [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). s += strlen(s); data/lgrind-3.67/source/lgrind.c:1245:11: [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). s += strlen(s); data/lgrind-3.67/source/lgrind.c:1260:11: [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). s += strlen(s); data/lgrind-3.67/source/lgrind.c:1275:11: [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). s += strlen(s); data/lgrind-3.67/source/lgrind.c:1283: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). s += strlen(s); data/lgrind-3.67/source/lgrindef.c:84:15: [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). p = tbuf + strlen(tbuf) - 2; /* before the last colon */ data/lgrind-3.67/source/lgrindef.c:108:29: [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). l = (int)(p - holdtbuf + strlen(q)); data/lgrind-3.67/source/lgutil.c:74:5: [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). strlen((**into).alternatives)+strlen(token)+1); data/lgrind-3.67/source/lgutil.c:74: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). strlen((**into).alternatives)+strlen(token)+1); data/lgrind-3.67/source/lgutil.c:114:31: [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 (*config=='\n' || config[strlen(config)-2]!='\\') data/lgrind-3.67/source/lgutil.c:129:10: [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). for (i=strlen((*lch).name)+strlen((*lch).alternatives); data/lgrind-3.67/source/lgutil.c:129:30: [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). for (i=strlen((*lch).name)+strlen((*lch).alternatives); data/lgrind-3.67/source/lgutil.c:210:5: [1] (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). Risk is low because the source is a constant character. strcpy(config, ""); data/lgrind-3.67/source/lgutil.c:259:30: [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). memcpy(i+7, newdefsfile, strlen(newdefsfile)+1); data/lgrind-3.67/source/lgutil.c:317:9: [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). i == strlen(substlistpos->var)) data/lgrind-3.67/source/regexp.c:164:28: [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). cre = (char*)malloc(4 * strlen(re) + 3); data/lgrind-3.67/source/regexp.c:465:8: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(mstring, s, (size_t)(s1 - s)); data/lgrind-3.67/source/retest.c:55:7: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getchar(); data/lgrind-3.67/source/retest.c:59:15: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = getchar()) != '\n') ANALYSIS SUMMARY: Hits = 103 Lines analyzed = 3285 in approximately 0.13 seconds (25181 lines/second) Physical Source Lines of Code (SLOC) = 2254 Hits@level = [0] 138 [1] 40 [2] 40 [3] 1 [4] 22 [5] 0 Hits@level+ = [0+] 241 [1+] 103 [2+] 63 [3+] 23 [4+] 22 [5+] 0 Hits/KSLOC@level+ = [0+] 106.921 [1+] 45.6965 [2+] 27.9503 [3+] 10.2041 [4+] 9.76043 [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.