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/looptools-2.8/src/include/fferr.h Examining data/looptools-2.8/src/include/ff.h Examining data/looptools-2.8/src/include/perm.h Examining data/looptools-2.8/src/include/ftypes.h Examining data/looptools-2.8/src/include/cexternals.h Examining data/looptools-2.8/src/include/ffwarn.h Examining data/looptools-2.8/src/include/lt.h Examining data/looptools-2.8/src/include/types.h Examining data/looptools-2.8/src/include/ffperm5.h Examining data/looptools-2.8/src/include/looptools.h Examining data/looptools-2.8/src/include/defs.h Examining data/looptools-2.8/src/include/externals.h Examining data/looptools-2.8/src/include/looptools-alt.h Examining data/looptools-2.8/src/tools/f77290.c Examining data/looptools-2.8/src/util/cache.c Examining data/looptools-2.8/src/util/solve-LU.h FINAL RESULTS: data/looptools-2.8/src/tools/f77290.c:75: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(s2, p + i); data/looptools-2.8/src/tools/f77290.c:76: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(p, to); data/looptools-2.8/src/tools/f77290.c:77:5: [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(p, s2); data/looptools-2.8/src/tools/f77290.c:79: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(s2, p + i); data/looptools-2.8/src/tools/f77290.c:80: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(p, to); data/looptools-2.8/src/tools/f77290.c:81:5: [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(p, s2); data/looptools-2.8/src/tools/f77290.c:204:7: [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(current->s, functype); data/looptools-2.8/src/tools/f77290.c:205:7: [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(current->s, *(fnp - 1) + 9); data/looptools-2.8/src/tools/f77290.c:222: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((char *)memccpy(d + (int)(p - s), *(pp + 1), 0, 10) - 1, data/looptools-2.8/src/tools/f77290.c:224: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((char *)memccpy(p, *(pp + 1), 0, 10) - 1, p + 4); data/looptools-2.8/src/tools/f77290.c:247:11: [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(d, p); data/looptools-2.8/src/tools/f77290.c:251: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(s2, p); data/looptools-2.8/src/tools/f77290.c:253: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(p + 3, s2); data/looptools-2.8/src/tools/f77290.c:270:15: [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(*cp, *cp + strspn(*cp, "0123456789 \t")); data/looptools-2.8/src/tools/f77290.c:281: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(d + 4, *--fnp); data/looptools-2.8/src/tools/f77290.c:310:11: [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(s2, p); data/looptools-2.8/src/tools/f77290.c:312:11: [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 += 9, s2); data/looptools-2.8/src/tools/f77290.c:317: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(s2, d2 = d + (int)((p += 6) - s + i)); data/looptools-2.8/src/tools/f77290.c:319: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(d2 + 3, s2); data/looptools-2.8/src/tools/f77290.c:330: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(p, p + 3); data/looptools-2.8/src/tools/f77290.c:334: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(p + 3,p + 6); data/looptools-2.8/src/tools/f77290.c:337: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(p, p + 4); data/looptools-2.8/src/tools/f77290.c:341: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(p + 3, p + 7); data/looptools-2.8/src/tools/f77290.c:356:7: [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(s, argv[1]); data/looptools-2.8/src/tools/f77290.c:117:12: [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( (p = getenv("MAXLINELENGTH")) ) maxllen = atoi(p); data/looptools-2.8/src/include/ftypes.h:22: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 zero[6]; data/looptools-2.8/src/include/ftypes.h:27:10: [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. unsigned char b[16]; data/looptools-2.8/src/tools/f77290.c:42: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 s[132]; data/looptools-2.8/src/tools/f77290.c:49:39: [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. if( p && (*(p + 1) | 0x20) == 'f' ) strcpy(p, ".f90"); data/looptools-2.8/src/tools/f77290.c:50:8: [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. else strcat(oldname, "90"); data/looptools-2.8/src/tools/f77290.c:71: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 *p, s2[200]; data/looptools-2.8/src/tools/f77290.c:90: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 s[512], s2[512], *p, *d, *d2; data/looptools-2.8/src/tools/f77290.c:91: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 fnstack[500], *funcname[10], **fnp = funcname; data/looptools-2.8/src/tools/f77290.c:92: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 functype[50], ch; data/looptools-2.8/src/tools/f77290.c:99: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 *dos[150], **dp = dos, **cp; data/looptools-2.8/src/tools/f77290.c:113: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). else if( (f = fopen(argv[1],"r")) == NULL ) { data/looptools-2.8/src/tools/f77290.c:117:49: [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). if( (p = getenv("MAXLINELENGTH")) ) maxllen = atoi(p); data/looptools-2.8/src/tools/f77290.c:173:42: [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. if( strstr(s, "#] declarations") ) strcpy(p, "\ncontinue"); data/looptools-2.8/src/tools/f77290.c:190: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(new, current, sizeof(SOURCELINE)); data/looptools-2.8/src/tools/f77290.c:193:7: [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(current->s, "use qcomplex"); data/looptools-2.8/src/tools/f77290.c:201: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(new, current, sizeof(SOURCELINE)); data/looptools-2.8/src/tools/f77290.c:245:11: [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(functype, d, i); data/looptools-2.8/src/tools/f77290.c:246:11: [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(functype + i, ":: "); data/looptools-2.8/src/tools/f77290.c:252:9: [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(p, ":: "); data/looptools-2.8/src/tools/f77290.c:275:15: [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(new->s, "enddo"); data/looptools-2.8/src/tools/f77290.c:311:11: [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(p, "complex32"); data/looptools-2.8/src/tools/f77290.c:318:9: [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(d2 - 6, "complex32"); data/looptools-2.8/src/tools/f77290.c:332:9: [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(p, p + 5, i = strcspn(p + 5, ")")); data/looptools-2.8/src/tools/f77290.c:333:9: [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(p += i, "%re"); data/looptools-2.8/src/tools/f77290.c:339:9: [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(p, p + 6, i = strcspn(p + 6, ")")); data/looptools-2.8/src/tools/f77290.c:340:9: [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(p += i, "%im"); data/looptools-2.8/src/tools/f77290.c:360:27: [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( f != stdout && (f = fopen(p,"w")) == NULL ) { data/looptools-2.8/src/util/cache.c:166: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(node->para, para, npara*sizeof(RealType)); data/looptools-2.8/src/util/cache.c:187: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(dest, val, *pnval*sizeof *dest); data/looptools-2.8/src/tools/f77290.c:74: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(from); data/looptools-2.8/src/tools/f77290.c:124: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) - 1) = 0; data/looptools-2.8/src/tools/f77290.c:132: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). d = last->s + (i = strlen(last->s)); data/looptools-2.8/src/tools/f77290.c:137:25: [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). cont = 1 + (i + strlen(p) < maxllen && last == current); data/looptools-2.8/src/tools/f77290.c:183: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). *(p += strlen(p)) = ch; data/looptools-2.8/src/tools/f77290.c:227: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). if( strncmp(s, *pp, strlen(*pp)) == 0 ) { data/looptools-2.8/src/tools/f77290.c:242: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( strncmp(s, *pp, i = strlen(*pp)) == 0 ) { data/looptools-2.8/src/tools/f77290.c:282:9: [1] (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 character. strcat(d + 4, "\n"); ANALYSIS SUMMARY: Hits = 62 Lines analyzed = 3702 in approximately 0.19 seconds (19204 lines/second) Physical Source Lines of Code (SLOC) = 3487 Hits@level = [0] 7 [1] 8 [2] 29 [3] 1 [4] 24 [5] 0 Hits@level+ = [0+] 69 [1+] 62 [2+] 54 [3+] 25 [4+] 24 [5+] 0 Hits/KSLOC@level+ = [0+] 19.7878 [1+] 17.7803 [2+] 15.4861 [3+] 7.16949 [4+] 6.88271 [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.