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/wordplay-8.0/wordplay.c FINAL RESULTS: data/wordplay-8.0/wordplay.c:150: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 (word_file_name, DEFAULT_WORD_FILE); data/wordplay-8.0/wordplay.c:172: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 (word_file_name, argv[iarg]); data/wordplay-8.0/wordplay.c:179: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 (first_word, argv[iarg]); data/wordplay-8.0/wordplay.c:244: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 (initword, uppercase(argv[iarg])); data/wordplay-8.0/wordplay.c:276: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 (pristineinitword, initword); data/wordplay-8.0/wordplay.c:277: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 (tempword, alphabetic (initword)); data/wordplay-8.0/wordplay.c:282: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 (initword, tempword); data/wordplay-8.0/wordplay.c:313: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 (u_first_word, uppercase(first_word)); data/wordplay-8.0/wordplay.c:314: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 (remaininitword, extract (initword, u_first_word)); data/wordplay-8.0/wordplay.c:382: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 (alphbuffer, alphabetic (buffer)); data/wordplay-8.0/wordplay.c:394: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 (ubuffer, uppercase (alphbuffer)); data/wordplay-8.0/wordplay.c:395: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 (leftover, extract (initword, ubuffer)); data/wordplay-8.0/wordplay.c:398: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 (w2memptr, uppercase(buffer)); data/wordplay-8.0/wordplay.c:464: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 (alphbuffer, alphabetic (words2[i])); data/wordplay-8.0/wordplay.c:506: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 (alphbuffer, alphabetic (words2[i])); data/wordplay-8.0/wordplay.c:507: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 (ubuffer, uppercase (alphbuffer)); data/wordplay-8.0/wordplay.c:508: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 (keymemptr, ubuffer); data/wordplay-8.0/wordplay.c:776: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 (accum[0], u_first_word); data/wordplay-8.0/wordplay.c:904: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 (exts, extract (s, wordss[i])); data/wordplay-8.0/wordplay.c:916: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 (accum[*level], words2ptrs[i]); data/wordplay-8.0/wordplay.c:917:37: [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). for (j = 0; j < *level; j++) {strcat (tempword, accum[j]); strcat(tempword, " ");} data/wordplay-8.0/wordplay.c:918: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(tempword, words2ptrs[i]); data/wordplay-8.0/wordplay.c:933: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 (accum[*level], words2ptrs[i]); data/wordplay-8.0/wordplay.c:978: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 (t1, s1); data/wordplay-8.0/wordplay.c:68: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 pristineinitword[MAX_WORD_LENGTH]; data/wordplay-8.0/wordplay.c:73: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 buffer[MAX_WORD_LENGTH]; data/wordplay-8.0/wordplay.c:74: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 ubuffer[MAX_WORD_LENGTH]; data/wordplay-8.0/wordplay.c:75: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 alphbuffer[MAX_WORD_LENGTH]; data/wordplay-8.0/wordplay.c:76: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 initword[MAX_WORD_LENGTH]; data/wordplay-8.0/wordplay.c:77: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 remaininitword[MAX_WORD_LENGTH]; data/wordplay-8.0/wordplay.c:78: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 word_file_name[MAX_PATH_LENGTH]; data/wordplay-8.0/wordplay.c:79: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 first_word[MAX_WORD_LENGTH]; data/wordplay-8.0/wordplay.c:80: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 u_first_word[MAX_WORD_LENGTH]; data/wordplay-8.0/wordplay.c:81: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 tempword[MAX_WORD_LENGTH]; data/wordplay-8.0/wordplay.c:105: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 leftover[MAX_WORD_LENGTH]; data/wordplay-8.0/wordplay.c:111: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 no[3] = "no"; data/wordplay-8.0/wordplay.c:112: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 yes[4] = "yes"; data/wordplay-8.0/wordplay.c:207:24: [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. case 'F' : strcpy (word_file_name, "/usr/share/dict/words"); data/wordplay-8.0/wordplay.c:361:26: [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 ((word_file_ptr = fopen (word_file_name, "r")) == NULL) data/wordplay-8.0/wordplay.c:792: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. static char upcasestr[MAX_WORD_LENGTH + 1]; data/wordplay-8.0/wordplay.c:803: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. static char alphstr[MAX_WORD_LENGTH + 1]; data/wordplay-8.0/wordplay.c:834: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 exts[MAX_WORD_LENGTH]; data/wordplay-8.0/wordplay.c:835: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 tempword[MAX_WORD_LENGTH+50]; data/wordplay-8.0/wordplay.c:971: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. static char r1[MAX_WORD_LENGTH]; data/wordplay-8.0/wordplay.c:972: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 t1[MAX_WORD_LENGTH]; data/wordplay-8.0/wordplay.c:186: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). if ((int) strlen(argv[iarg]) > 1) data/wordplay-8.0/wordplay.c:189: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). while (i < (int) strlen(argv[iarg])) data/wordplay-8.0/wordplay.c:278:6: [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(initword) != strlen(alphabetic (initword))) data/wordplay-8.0/wordplay.c:278:26: [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(initword) != strlen(alphabetic (initword))) data/wordplay-8.0/wordplay.c:284: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). ilength = (int) strlen (initword); data/wordplay-8.0/wordplay.c:321: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). if (strlen (remaininitword) == 0) data/wordplay-8.0/wordplay.c:376: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). j = (int) strlen (buffer) - 1; data/wordplay-8.0/wordplay.c:384: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 (((int) strlen (alphbuffer) < mincwordlength) || data/wordplay-8.0/wordplay.c:385: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). ((int) strlen (alphbuffer) > maxcwordlength)) data/wordplay-8.0/wordplay.c:389: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). for (j = 0; j < (int) strlen (buffer); j++) data/wordplay-8.0/wordplay.c:399: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). w2memptr += strlen (buffer) + 1; data/wordplay-8.0/wordplay.c:400: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). w2offset += strlen (buffer) + 1; data/wordplay-8.0/wordplay.c:402: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). if ((int) strlen (alphbuffer) > longestlength) data/wordplay-8.0/wordplay.c:403:23: [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). longestlength = strlen (alphbuffer); data/wordplay-8.0/wordplay.c:437: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). ( (strlen(words2mem + i + 1)) == strlen(alphabetic(words2mem + i + 1)) ) ) data/wordplay-8.0/wordplay.c:437:43: [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(words2mem + i + 1)) == strlen(alphabetic(words2mem + i + 1)) ) ) data/wordplay-8.0/wordplay.c:465:23: [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). wordsn[i] = (int) strlen (alphbuffer); data/wordplay-8.0/wordplay.c:528:18: [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). size = (int) strlen (wordss[k]); data/wordplay-8.0/wordplay.c:795: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). for (i = 0; i < (int) strlen (s); i++) upcasestr[i] = toupper(s[i]); data/wordplay-8.0/wordplay.c:807: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). for (i = 0; i < (int) strlen (s); i++) data/wordplay-8.0/wordplay.c:860:48: [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 ((max_depth - *level) * longestlength < strlen(s)) data/wordplay-8.0/wordplay.c:917:66: [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. for (j = 0; j < *level; j++) {strcat (tempword, accum[j]); strcat(tempword, " ");} data/wordplay-8.0/wordplay.c:980: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). s1len = (int) strlen (s1p); data/wordplay-8.0/wordplay.c:984: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). s2len = (int) strlen (s2); ANALYSIS SUMMARY: Hits = 69 Lines analyzed = 1029 in approximately 0.05 seconds (19299 lines/second) Physical Source Lines of Code (SLOC) = 762 Hits@level = [0] 65 [1] 24 [2] 21 [3] 0 [4] 24 [5] 0 Hits@level+ = [0+] 134 [1+] 69 [2+] 45 [3+] 24 [4+] 24 [5+] 0 Hits/KSLOC@level+ = [0+] 175.853 [1+] 90.5512 [2+] 59.0551 [3+] 31.4961 [4+] 31.4961 [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.