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/libxfce4util-4.15.4/libxfce4util/libxfce4util-alias.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-utf8.c Examining data/libxfce4util-4.15.4/libxfce4util/xfce-license.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-utf8.h Examining data/libxfce4util-4.15.4/libxfce4util/libxfce4util-config.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-miscutils.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-generics.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-posix-signal-handler.h Examining data/libxfce4util-4.15.4/libxfce4util/libxfce4util-private.h Examining data/libxfce4util-4.15.4/libxfce4util/libxfce4util-private.c Examining data/libxfce4util-4.15.4/libxfce4util/xfce-debug.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-posix-signal-handler.c Examining data/libxfce4util-4.15.4/libxfce4util/libxfce4util-aliasdef.c Examining data/libxfce4util-4.15.4/libxfce4util/libxfce4util-config.c Examining data/libxfce4util-4.15.4/libxfce4util/libxfce4util.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-rc.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-i18n.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-license.c Examining data/libxfce4util-4.15.4/libxfce4util/xfce-fileutils.c Examining data/libxfce4util-4.15.4/libxfce4util/xfce-resource.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-i18n.c Examining data/libxfce4util-4.15.4/libxfce4util/xfce-kiosk.c Examining data/libxfce4util-4.15.4/libxfce4util/xfce-miscutils.c Examining data/libxfce4util-4.15.4/libxfce4util/xfce-private.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-rc-simple.c Examining data/libxfce4util-4.15.4/libxfce4util/xfce-rc-config.c Examining data/libxfce4util-4.15.4/libxfce4util/xfce-kiosk.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-rc-private.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-fileutils.h Examining data/libxfce4util-4.15.4/libxfce4util/xfce-resource.c Examining data/libxfce4util-4.15.4/libxfce4util/xfce-rc.c Examining data/libxfce4util-4.15.4/xfce4-kiosk-query/main.c FINAL RESULTS: data/libxfce4util-4.15.4/libxfce4util/xfce-rc-simple.c:712:11: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. if (readlink (simple->filename, buf, sizeof (buf)-1) != -1) data/libxfce4util-4.15.4/libxfce4util/xfce-debug.h:50:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, __VA_ARGS__); \ data/libxfce4util-4.15.4/libxfce4util/xfce-debug.h:59:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, fmt, ##args); \ data/libxfce4util-4.15.4/libxfce4util/xfce-debug.h:71:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, __VA_ARGS__); \ data/libxfce4util-4.15.4/libxfce4util/xfce-debug.h:80:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, fmt, ##args); \ data/libxfce4util-4.15.4/libxfce4util/xfce-i18n.c:107: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. lang = getenv ("LANG"); data/libxfce4util-4.15.4/libxfce4util/xfce-miscutils.c:95:9: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. dir = g_get_home_dir (); data/libxfce4util-4.15.4/xfce4-kiosk-query/main.c:65:16: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((ch = getopt (argc, argv, "hv")) != -1) data/libxfce4util-4.15.4/libxfce4util/xfce-fileutils.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 path[1024]; data/libxfce4util-4.15.4/libxfce4util/xfce-miscutils.c:302: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 hostname[MAXHOSTNAMELEN]; data/libxfce4util-4.15.4/libxfce4util/xfce-rc-simple.c:487:8: [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 (filename, "w"); data/libxfce4util-4.15.4/libxfce4util/xfce-rc-simple.c:639:8: [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 (simple->filename, "r"); data/libxfce4util-4.15.4/libxfce4util/xfce-resource.c:319: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 (*current, pattern, p - pattern); data/libxfce4util-4.15.4/libxfce4util/xfce-fileutils.c:121:20: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). oumask = umask(0); data/libxfce4util-4.15.4/libxfce4util/xfce-fileutils.c:123:11: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(numask); data/libxfce4util-4.15.4/libxfce4util/xfce-fileutils.c:128:9: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(oumask); data/libxfce4util-4.15.4/libxfce4util/xfce-fileutils.c:153:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (oumask); data/libxfce4util-4.15.4/libxfce4util/xfce-i18n.c:353:19: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (dst, buffer, size); data/libxfce4util-4.15.4/libxfce4util/xfce-i18n.c:368:27: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (dst, buffer, size); data/libxfce4util-4.15.4/libxfce4util/xfce-miscutils.c:366: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). buf = g_string_sized_new (strlen (command)); data/libxfce4util-4.15.4/libxfce4util/xfce-miscutils.c:508: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). string = g_string_sized_new (strlen (command)); data/libxfce4util-4.15.4/libxfce4util/xfce-rc-config.c:123:34: [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). g_return_val_if_fail (resource[strlen (resource) - 1] != G_DIR_SEPARATOR, NULL); data/libxfce4util-4.15.4/libxfce4util/xfce-rc-simple.c:357: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). q = r + strlen (r); data/libxfce4util-4.15.4/libxfce4util/xfce-resource.c:146: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). len = strlen (path); data/libxfce4util-4.15.4/libxfce4util/xfce-resource.c:157: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). else if (len < strlen (path)) data/libxfce4util-4.15.4/libxfce4util/xfce-resource.c:357: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). guint end = strlen (pattern_this) - 1; data/libxfce4util-4.15.4/libxfce4util/xfce-resource.c:498: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 (filename[strlen (filename) - 1] == G_DIR_SEPARATOR) data/libxfce4util-4.15.4/libxfce4util/xfce-resource.c:552: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 (filename[strlen (filename) - 1] == G_DIR_SEPARATOR) data/libxfce4util-4.15.4/libxfce4util/xfce-resource.c:793: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 (relpath[strlen (relpath) - 1] == G_DIR_SEPARATOR) ANALYSIS SUMMARY: Hits = 29 Lines analyzed = 7241 in approximately 0.32 seconds (22574 lines/second) Physical Source Lines of Code (SLOC) = 4141 Hits@level = [0] 20 [1] 16 [2] 5 [3] 3 [4] 4 [5] 1 Hits@level+ = [0+] 49 [1+] 29 [2+] 13 [3+] 8 [4+] 5 [5+] 1 Hits/KSLOC@level+ = [0+] 11.8329 [1+] 7.00314 [2+] 3.13934 [3+] 1.9319 [4+] 1.20744 [5+] 0.241488 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.