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/squeak-plugins-scratch-1.4.0.2~svn.r83/unicode/UnicodePlugin.c Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/unicode/sqVirtualMachine.h Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/unicode/UnicodeOps-linux.c Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/scratchOps.h Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/ScratchPlugin.c Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixSeriaPort2Ops.c Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/sqVirtualMachine.h Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/wedo/WeDoPlugin.c Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/wedo/WeDoLinux.c Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/wedo/sqVirtualMachine.h Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/camera/sqCamera-linux.c Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/camera/sqCamera.h Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/camera/sqVirtualMachine.h Examining data/squeak-plugins-scratch-1.4.0.2~svn.r83/camera/CameraPlugin.c FINAL RESULTS: data/squeak-plugins-scratch-1.4.0.2~svn.r83/camera/sqCamera-linux.c:742:2: [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(deviceName, videoDevName0); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c:9:3: [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( cmd, url); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c:10:3: [4] (shell) system: 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. system(cmd); data/squeak-plugins-scratch-1.4.0.2~svn.r83/wedo/WeDoLinux.c:122: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(hiddevFileName, fileTemplate); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c:31:6: [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. s = getenv("HOME"); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c:42: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. s = getenv("SUGAR_ACTIVITY_ROOT"); data/squeak-plugins-scratch-1.4.0.2~svn.r83/camera/sqCamera-linux.c:179:12: [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). vd_open = open; data/squeak-plugins-scratch-1.4.0.2~svn.r83/camera/sqCamera-linux.c:466:2: [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(cam->inBuffer, cam->buffers[bufPtr->index].start, cam->inBufferSize); data/squeak-plugins-scratch-1.4.0.2~svn.r83/camera/sqCamera-linux.c:739: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 deviceName[12]; data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/ScratchPlugin.c:332: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 nameStr[1000]; data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/ScratchPlugin.c:377: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 nameStr[1000]; data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/ScratchPlugin.c:857: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 nameStr[2000]; data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/ScratchPlugin.c:1193: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 fullPath[1000]; data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/ScratchPlugin.c:1225: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 urlStr[2000]; data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/ScratchPlugin.c:1502: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 titleStr[1000]; data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/ScratchPlugin.c:1534: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 longPath[1000]; data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/ScratchPlugin.c:1537: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 shortPath[1000]; data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c:8: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 cmd[1000] = "xdg-open "; data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixSeriaPort2Ops.c:275:11: [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). fDescr = open(bsdPath, O_RDWR | O_NOCTTY | O_NONBLOCK); data/squeak-plugins-scratch-1.4.0.2~svn.r83/unicode/UnicodeOps-linux.c:222: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 description[200]; data/squeak-plugins-scratch-1.4.0.2~svn.r83/unicode/UnicodePlugin.c:250: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 fontName[200]; data/squeak-plugins-scratch-1.4.0.2~svn.r83/wedo/WeDoLinux.c:49: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 hiddevFileTemplates[NTEMPLATES][MAXSTRLEN] = { data/squeak-plugins-scratch-1.4.0.2~svn.r83/wedo/WeDoLinux.c:54: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 hiddevFileName[MAXSTRLEN]; data/squeak-plugins-scratch-1.4.0.2~svn.r83/wedo/WeDoLinux.c:124:18: [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). if (-1 != (f = open(hiddevFileName, O_RDWR))) data/squeak-plugins-scratch-1.4.0.2~svn.r83/camera/CameraPlugin.c:55: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). count = strlen(nameStr); data/squeak-plugins-scratch-1.4.0.2~svn.r83/camera/sqCamera-linux.c:183:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). vd_read = read; data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/ScratchPlugin.c:389: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). count = strlen(nameStr); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/ScratchPlugin.c:869: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). count = strlen(nameStr); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/ScratchPlugin.c:1559: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). count = strlen(longPath); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c:32:22: [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 ((s == NULL) || (strlen(s) == 0)) return; data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c:34:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path, s, maxPath); // home folder data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c:37:21: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. if (folderID == 2) strncat(path, "/Desktop", maxPath); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c:38:21: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. if (folderID == 4) strncat(path, "/Pictures", maxPath); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c:39:21: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. if (folderID == 5) strncat(path, "/Music", maxPath); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c:45:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path, s, maxPath); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c:46:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(path, "/data", maxPath); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixScratchOps.c:48:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(path, "/Documents", maxPath); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixSeriaPort2Ops.c:79:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(bsdPath, "/dev/", maxPathSize); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixSeriaPort2Ops.c:80:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(bsdPath, entryPtr->d_name, maxPathSize); data/squeak-plugins-scratch-1.4.0.2~svn.r83/scratch/unixSeriaPort2Ops.c:122:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). count = read(fDescr, bufPtr, bufSize); data/squeak-plugins-scratch-1.4.0.2~svn.r83/unicode/UnicodeOps-linux.c:121:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(str, pango_font_family_get_name(fontFomilies[i]), strLength); data/squeak-plugins-scratch-1.4.0.2~svn.r83/unicode/UnicodeOps-linux.c:122:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant character. strncat(str, "\n", strLength); data/squeak-plugins-scratch-1.4.0.2~svn.r83/unicode/UnicodeOps-linux.c:125: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). return strlen(str); data/squeak-plugins-scratch-1.4.0.2~svn.r83/wedo/WeDoLinux.c:123: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). hiddevFileName[strlen(hiddevFileName)-1] = '0' + i; ANALYSIS SUMMARY: Hits = 44 Lines analyzed = 4737 in approximately 0.13 seconds (35949 lines/second) Physical Source Lines of Code (SLOC) = 3727 Hits@level = [0] 7 [1] 20 [2] 18 [3] 2 [4] 4 [5] 0 Hits@level+ = [0+] 51 [1+] 44 [2+] 24 [3+] 6 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 13.6839 [1+] 11.8057 [2+] 6.4395 [3+] 1.60987 [4+] 1.07325 [5+] 0 Dot directories skipped = 6 (--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.