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/gtk-chtheme-0.3.1/font_sel.c Examining data/gtk-chtheme-0.3.1/font_sel.h Examining data/gtk-chtheme-0.3.1/preview_pane.c Examining data/gtk-chtheme-0.3.1/preview_pane.h Examining data/gtk-chtheme-0.3.1/stock.c Examining data/gtk-chtheme-0.3.1/stock.h Examining data/gtk-chtheme-0.3.1/theme_sel.h Examining data/gtk-chtheme-0.3.1/util.h Examining data/gtk-chtheme-0.3.1/mainwin.c Examining data/gtk-chtheme-0.3.1/mainwin.h Examining data/gtk-chtheme-0.3.1/about_dialog.c Examining data/gtk-chtheme-0.3.1/about_dialog.h Examining data/gtk-chtheme-0.3.1/main.c Examining data/gtk-chtheme-0.3.1/main.h Examining data/gtk-chtheme-0.3.1/theme_sel.c Examining data/gtk-chtheme-0.3.1/util.c FINAL RESULTS: data/gtk-chtheme-0.3.1/main.c:104:54: [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. fprintf(gtkrc_fh, "include \"%s/.gtkrc.mine\"\n\n", getenv("HOME")); data/gtk-chtheme-0.3.1/main.c:190:14: [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. g_strconcat(getenv("HOME"), "/.themes", NULL); data/gtk-chtheme-0.3.1/main.c:228:53: [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. gchar *file_uri = g_strdup_printf("%s/.gtkrc.bak", getenv("HOME")); data/gtk-chtheme-0.3.1/main.c:243:43: [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. gtkrc = g_strdup_printf("%s/.gtkrc-2.0", getenv("HOME")); data/gtk-chtheme-0.3.1/main.c:249:30: [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. read_theme_list(g_strconcat(getenv("HOME"), "/.themes", NULL)); data/gtk-chtheme-0.3.1/main.c:87:14: [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). gtkrc_fh = fopen(gtkrc, "w"); data/gtk-chtheme-0.3.1/main.c:188:26: [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). g_scanner_input_file(s, open(gtkrc, O_RDONLY)); data/gtk-chtheme-0.3.1/main.c:224:15: [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(!(gtkrc = fopen(path_to_gtkrc, "r"))) data/gtk-chtheme-0.3.1/main.c:229:23: [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 *gtkrc_backup = fopen(file_uri, "w"); data/gtk-chtheme-0.3.1/main.c:231:13: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((c = fgetc(gtkrc)) != EOF){ ANALYSIS SUMMARY: Hits = 10 Lines analyzed = 1055 in approximately 0.06 seconds (16289 lines/second) Physical Source Lines of Code (SLOC) = 615 Hits@level = [0] 6 [1] 1 [2] 4 [3] 5 [4] 0 [5] 0 Hits@level+ = [0+] 16 [1+] 10 [2+] 9 [3+] 5 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 26.0163 [1+] 16.2602 [2+] 14.6341 [3+] 8.13008 [4+] 0 [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.