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/labltk-8.06.9/browser/winmain.c Examining data/labltk-8.06.9/config/auto-aux/tclversion.c Examining data/labltk-8.06.9/support/camltk.h Examining data/labltk-8.06.9/support/cltkCaml.c Examining data/labltk-8.06.9/support/cltkDMain.c Examining data/labltk-8.06.9/support/cltkEval.c Examining data/labltk-8.06.9/support/cltkEvent.c Examining data/labltk-8.06.9/support/cltkFile.c Examining data/labltk-8.06.9/support/cltkImg.c Examining data/labltk-8.06.9/support/cltkMain.c Examining data/labltk-8.06.9/support/cltkMisc.c Examining data/labltk-8.06.9/support/cltkTimer.c Examining data/labltk-8.06.9/support/cltkUtf.c Examining data/labltk-8.06.9/support/cltkVar.c Examining data/labltk-8.06.9/support/cltkWait.c FINAL RESULTS: data/labltk-8.06.9/support/cltkDMain.c:220: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(f, home); data/labltk-8.06.9/support/cltkDMain.c:222: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(f, RCNAME); data/labltk-8.06.9/support/cltkDMain.c:223:16: [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 (0 == access(f,R_OK)) data/labltk-8.06.9/support/cltkEval.c:150: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(argv[where], merged); data/labltk-8.06.9/support/cltkMain.c:162: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(f, home); data/labltk-8.06.9/support/cltkMain.c:164: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(f, RCNAME); data/labltk-8.06.9/support/cltkMain.c:165:16: [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 (0 == access(f,R_OK)) data/labltk-8.06.9/support/cltkDMain.c:216:18: [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. char *home = getenv("HOME"); data/labltk-8.06.9/support/cltkMain.c:158:18: [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. char *home = getenv("HOME"); data/labltk-8.06.9/browser/winmain.c:30: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 exe_name[1024]; data/labltk-8.06.9/browser/winmain.c:31: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 * argv[2]; data/labltk-8.06.9/support/cltkDMain.c:87: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[TRAILER_SIZE]; data/labltk-8.06.9/support/cltkDMain.c:109: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 buf [2]; data/labltk-8.06.9/support/cltkDMain.c:113:8: [2] (misc) open: 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). fd = open(truename, O_RDONLY | O_BINARY); data/labltk-8.06.9/support/cltkEval.c:230:21: [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. caml_stat_free((char *) allocated[i]); data/labltk-8.06.9/support/cltkImg.c:59: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(pib.pixelPtr, String_val(res),size); data/labltk-8.06.9/support/cltkMain.c:114: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 argcstr[256]; /* string of argc */ data/labltk-8.06.9/support/cltkMain.c:126:9: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf( argcstr, "%d", argc ); data/labltk-8.06.9/support/cltkDMain.c:90:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buffer, TRAILER_SIZE) < TRAILER_SIZE) return TRUNCATED_FILE; data/labltk-8.06.9/support/cltkDMain.c:116:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). err = read (fd, buf, 2); data/labltk-8.06.9/support/cltkDMain.c:166:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, (char *) start_code, code_size) != code_size) data/labltk-8.06.9/support/cltkDMain.c:218: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). char *f = caml_stat_alloc(strlen(home)+strlen(RCNAME)+2); data/labltk-8.06.9/support/cltkDMain.c:218:46: [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). char *f = caml_stat_alloc(strlen(home)+strlen(RCNAME)+2); data/labltk-8.06.9/support/cltkDMain.c:221:7: [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(f, "/"); data/labltk-8.06.9/support/cltkEval.c:149:44: [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). argv[where] = (char*)caml_stat_alloc(strlen(merged)+1); data/labltk-8.06.9/support/cltkMain.c:160: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). char *f = caml_stat_alloc(strlen(home)+strlen(RCNAME)+2); data/labltk-8.06.9/support/cltkMain.c:160:46: [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). char *f = caml_stat_alloc(strlen(home)+strlen(RCNAME)+2); data/labltk-8.06.9/support/cltkMain.c:163:7: [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(f, "/"); data/labltk-8.06.9/support/cltkUtf.c:44:39: [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). Tcl_ExternalToUtfDString(NULL, str, strlen(str), &dstr); data/labltk-8.06.9/support/cltkUtf.c:58:39: [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). Tcl_UtfToExternalDString(NULL, str, strlen(str), &dstr); ANALYSIS SUMMARY: Hits = 30 Lines analyzed = 1641 in approximately 0.58 seconds (2822 lines/second) Physical Source Lines of Code (SLOC) = 1012 Hits@level = [0] 0 [1] 12 [2] 9 [3] 2 [4] 7 [5] 0 Hits@level+ = [0+] 30 [1+] 30 [2+] 18 [3+] 9 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 29.6443 [1+] 29.6443 [2+] 17.7866 [3+] 8.89328 [4+] 6.917 [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.