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/compiz-plugins-main-0.8.18/include/compiz-animation.h Examining data/compiz-plugins-main-0.8.18/include/compiz-text.h Examining data/compiz-plugins-main-0.8.18/include/compiz-mousepoll.h Examining data/compiz-plugins-main-0.8.18/include/compiz-focuspoll.h Examining data/compiz-plugins-main-0.8.18/src/vpswitch/vpswitch.c Examining data/compiz-plugins-main-0.8.18/src/titleinfo/titleinfo.c Examining data/compiz-plugins-main-0.8.18/src/resizeinfo/resizeinfo.c Examining data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c Examining data/compiz-plugins-main-0.8.18/src/colorfilter/colorfilter.c Examining data/compiz-plugins-main-0.8.18/src/colorfilter/parser.h Examining data/compiz-plugins-main-0.8.18/src/jpeg/imgjpeg.c Examining data/compiz-plugins-main-0.8.18/src/opacify/opacify.c Examining data/compiz-plugins-main-0.8.18/src/neg/neg.c Examining data/compiz-plugins-main-0.8.18/src/scaleaddon/scaleaddon.c Examining data/compiz-plugins-main-0.8.18/src/ezoom/ezoom.c Examining data/compiz-plugins-main-0.8.18/src/staticswitcher/staticswitcher.c Examining data/compiz-plugins-main-0.8.18/src/thumbnail/thumbnail.c Examining data/compiz-plugins-main-0.8.18/src/thumbnail/thumbnail_tex.h Examining data/compiz-plugins-main-0.8.18/src/mag/mag.c Examining data/compiz-plugins-main-0.8.18/src/ring/ring.c Examining data/compiz-plugins-main-0.8.18/src/snap/snap.c Examining data/compiz-plugins-main-0.8.18/src/workarounds/workarounds.c Examining data/compiz-plugins-main-0.8.18/src/mousepoll/mousepoll.c Examining data/compiz-plugins-main-0.8.18/src/text/text.c Examining data/compiz-plugins-main-0.8.18/src/put/put.c Examining data/compiz-plugins-main-0.8.18/src/focuspoll/focusinfo.cpp Examining data/compiz-plugins-main-0.8.18/src/focuspoll/accessibilitywatcher.h Examining data/compiz-plugins-main-0.8.18/src/focuspoll/focusinfo.h Examining data/compiz-plugins-main-0.8.18/src/focuspoll/focuspoll.cpp Examining data/compiz-plugins-main-0.8.18/src/focuspoll/accessibilitywatcher.cpp Examining data/compiz-plugins-main-0.8.18/src/expo/expo.c Examining data/compiz-plugins-main-0.8.18/src/session/session.c Examining data/compiz-plugins-main-0.8.18/src/shift/shift.c Examining data/compiz-plugins-main-0.8.18/src/winrules/winrules.c Examining data/compiz-plugins-main-0.8.18/src/animation/animation-internal.h Examining data/compiz-plugins-main-0.8.18/src/animation/glide.c Examining data/compiz-plugins-main-0.8.18/src/animation/focusfade.c Examining data/compiz-plugins-main-0.8.18/src/animation/fade.c Examining data/compiz-plugins-main-0.8.18/src/animation/rollup.c Examining data/compiz-plugins-main-0.8.18/src/animation/options.c Examining data/compiz-plugins-main-0.8.18/src/animation/zoomside.c Examining data/compiz-plugins-main-0.8.18/src/animation/animation.c Examining data/compiz-plugins-main-0.8.18/src/animation/curvedfold.c Examining data/compiz-plugins-main-0.8.18/src/animation/dream.c Examining data/compiz-plugins-main-0.8.18/src/animation/magiclamp.c Examining data/compiz-plugins-main-0.8.18/src/animation/horizontalfold.c Examining data/compiz-plugins-main-0.8.18/src/animation/dodge.c Examining data/compiz-plugins-main-0.8.18/src/animation/wave.c FINAL RESULTS: data/compiz-plugins-main-0.8.18/src/animation/options.c:97:5: [4] (buffer) sscanf: 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. sscanf(optNamesValuesOrig, " %s ", optNamesValues); data/compiz-plugins-main-0.8.18/src/animation/options.c:104: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(optNamesValues, optNamesValuesOrig); data/compiz-plugins-main-0.8.18/src/animation/options.c:151:2: [4] (buffer) sscanf: 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. sscanf(name, " %s ", nameTrimmed); data/compiz-plugins-main-0.8.18/src/animation/options.c:262: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(v.s, valueStr); data/compiz-plugins-main-0.8.18/src/colorfilter/colorfilter.c:187:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf (message, sizeof (message) / sizeof (message[0]), fmt, ap); data/compiz-plugins-main-0.8.18/src/mag/mag.c:162:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buffer, fisheyeFpString, "2D"); data/compiz-plugins-main-0.8.18/src/mag/mag.c:164:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf (buffer, fisheyeFpString, "RECT"); data/compiz-plugins-main-0.8.18/src/session/session.c:524: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 (filename, p->pw_dir); data/compiz-plugins-main-0.8.18/src/session/session.c:532:6: [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 (filename, clientId); data/compiz-plugins-main-0.8.18/src/session/session.c:813:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (filename, "%s/.compiz/session/%s", p->pw_dir, previousId); data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:115:41: [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 *data, *path = NULL, *home = getenv ("HOME"); data/compiz-plugins-main-0.8.18/src/animation/animation.c:98: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 *eventNames[AnimEventNum] = data/compiz-plugins-main-0.8.18/src/animation/animation.c:758: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 (&aw->lastBB, &aw->BB, sizeof (Box)); data/compiz-plugins-main-0.8.18/src/animation/animation.c:896:6: [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 (fullTransform.m, aw->com.transform.m, sizeof (float) * 16); data/compiz-plugins-main-0.8.18/src/animation/animation.c:1070:10: [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(&retval, data, sizeof(int)); data/compiz-plugins-main-0.8.18/src/animation/animation.c:2945:8: [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(v + nVertX * vSize, v, data/compiz-plugins-main-0.8.18/src/animation/animation.c:2991: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(v + nVertX * vSize, v, 3 * sizeof(GLfloat)); data/compiz-plugins-main-0.8.18/src/animation/animation.c:3449: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(as->lastClientListStacking, clientListStacking, data/compiz-plugins-main-0.8.18/src/animation/animation.c:4860: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 (animEffects, data/compiz-plugins-main-0.8.18/src/colorfilter/colorfilter.c:181: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 message[2048]; data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:119: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). fp = fopen (fname, "r"); data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:126: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). fp = fopen (path, "r"); data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:136: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). fp = fopen (path, "r"); data/compiz-plugins-main-0.8.18/src/jpeg/imgjpeg.c:129: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 buffer[JMSG_LENGTH_MAX]; data/compiz-plugins-main-0.8.18/src/jpeg/imgjpeg.c:319: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 = fopen (fileName, "wb"); data/compiz-plugins-main-0.8.18/src/jpeg/imgjpeg.c:357:13: [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 = fopen (fileName, "rb"); data/compiz-plugins-main-0.8.18/src/mag/mag.c:153: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 buffer[1024]; data/compiz-plugins-main-0.8.18/src/resizeinfo/resizeinfo.c:175: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 info[50]; data/compiz-plugins-main-0.8.18/src/session/session.c:525:5: [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 (filename, "/.compiz"); data/compiz-plugins-main-0.8.18/src/session/session.c:528:2: [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 (filename, "/session"); data/compiz-plugins-main-0.8.18/src/shift/shift.c:1102: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(wins, ss->windows, ss->nWindows * sizeof (CompWindow *)); data/compiz-plugins-main-0.8.18/src/thumbnail/thumbnail_tex.h:4: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 glowTex[4096] = { data/compiz-plugins-main-0.8.18/src/thumbnail/thumbnail_tex.h:175: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 windowTex[4096] = { data/compiz-plugins-main-0.8.18/src/titleinfo/titleinfo.c:77: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 hostname[256]; data/compiz-plugins-main-0.8.18/src/titleinfo/titleinfo.c:134:6: [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 (&value, propVal, sizeof (unsigned long)); data/compiz-plugins-main-0.8.18/src/titleinfo/titleinfo.c:143: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 path[512]; data/compiz-plugins-main-0.8.18/src/animation/options.c:93: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). int len = strlen(optNamesValuesOrig); data/compiz-plugins-main-0.8.18/src/animation/options.c:98: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(optNamesValues) == 0) data/compiz-plugins-main-0.8.18/src/animation/options.c:152: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(nameTrimmed) == 0) data/compiz-plugins-main-0.8.18/src/animation/options.c:203:60: [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("animation", co->value.list.value[k].s, strlen("animation"))) { data/compiz-plugins-main-0.8.18/src/animation/options.c:255:20: [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). v.s = calloc (strlen(valueStr) + 1, 1); // TODO: not freed data/compiz-plugins-main-0.8.18/src/colorfilter/colorfilter.c:377: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 (!name || !strlen (name)) data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:63: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). length = strlen (str); data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:122:24: [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 (!fp && home && strlen (home)) data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:205: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). length = strlen (string); data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:210: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). length = strlen (string); data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:217:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (arg, string, length); data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:221: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). if (string - orig + strlen (arg) + 1 <= strlen (*source)) data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:221:45: [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 (string - orig + strlen (arg) + 1 <= strlen (*source)) data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:222: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). *source += string - orig + strlen (arg) + 1; data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:243: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 (source) < 5) data/compiz-plugins-main-0.8.18/src/colorfilter/parser.c:442: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). length = strlen (current); data/compiz-plugins-main-0.8.18/src/mag/mag.c:175: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 (buffer), buffer); data/compiz-plugins-main-0.8.18/src/session/session.c:520: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). (strlen (p->pw_dir) + strlen (clientId) + 18)); data/compiz-plugins-main-0.8.18/src/session/session.c:520:32: [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 (p->pw_dir) + strlen (clientId) + 18)); data/compiz-plugins-main-0.8.18/src/session/session.c:531:6: [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 (filename, "/"); data/compiz-plugins-main-0.8.18/src/session/session.c:809: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). (strlen (p->pw_dir) + strlen (previousId) + 18)); data/compiz-plugins-main-0.8.18/src/session/session.c:809:32: [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 (p->pw_dir) + strlen (previousId) + 18)); data/compiz-plugins-main-0.8.18/src/text/text.c:103:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (retval, val, nItems); data/compiz-plugins-main-0.8.18/src/text/text.c:130:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (retval, (char *) text.value, text.nitems); data/compiz-plugins-main-0.8.18/src/text/text.c:400: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). if (!text || !strlen (text)) data/compiz-plugins-main-0.8.18/src/titleinfo/titleinfo.c:100: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). (unsigned char *) text, strlen (text)); data/compiz-plugins-main-0.8.18/src/titleinfo/titleinfo.c:177:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (retval, val, nItems); data/compiz-plugins-main-0.8.18/src/titleinfo/titleinfo.c:204:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (retval, (char *) text.value, text.nitems); ANALYSIS SUMMARY: Hits = 64 Lines analyzed = 38224 in approximately 0.83 seconds (46307 lines/second) Physical Source Lines of Code (SLOC) = 29082 Hits@level = [0] 13 [1] 28 [2] 25 [3] 1 [4] 10 [5] 0 Hits@level+ = [0+] 77 [1+] 64 [2+] 36 [3+] 11 [4+] 10 [5+] 0 Hits/KSLOC@level+ = [0+] 2.64769 [1+] 2.20067 [2+] 1.23788 [3+] 0.378241 [4+] 0.343855 [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.