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/gnome-user-share-3.34.0/src/http.c Examining data/gnome-user-share-3.34.0/src/http.h Examining data/gnome-user-share-3.34.0/src/nautilus-share-bar.c Examining data/gnome-user-share-3.34.0/src/nautilus-share-bar.h Examining data/gnome-user-share-3.34.0/src/share-extension.c Examining data/gnome-user-share-3.34.0/src/user_share-common.c Examining data/gnome-user-share-3.34.0/src/user_share-common.h Examining data/gnome-user-share-3.34.0/src/user_share-private.c Examining data/gnome-user-share-3.34.0/src/user_share-private.h Examining data/gnome-user-share-3.34.0/src/user_share-webdav.c FINAL RESULTS: data/gnome-user-share-3.34.0/src/http.c:321:49: [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. free4 = env[i++] = g_strdup_printf ("HOME=%s", g_get_home_dir()); data/gnome-user-share-3.34.0/src/http.c:336:22: [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. res = g_spawn_sync (g_get_home_dir(), data/gnome-user-share-3.34.0/src/share-extension.c:99:30: [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. home = g_file_new_for_path (g_get_home_dir ()); data/gnome-user-share-3.34.0/src/user_share-common.c:38:50: [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. if (special_dir != NULL && strcmp (special_dir, g_get_home_dir ()) != 0) { data/gnome-user-share-3.34.0/src/user_share-common.c:44:26: [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_build_filename (g_get_home_dir (), name, NULL); data/gnome-user-share-3.34.0/src/user_share-webdav.c:45:37: [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. old_config_dir = g_build_filename (g_get_home_dir (), ".gnome2", "user-share", NULL); data/gnome-user-share-3.34.0/src/http.c:274: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 *argv[10]; data/gnome-user-share-3.34.0/src/http.c:275: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 *env[10]; data/gnome-user-share-3.34.0/src/http.c:373:15: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). *pid_out = atoi (pidfile); data/gnome-user-share-3.34.0/src/http.c:135: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 (name) < AVAHI_LABEL_MAX) ANALYSIS SUMMARY: Hits = 10 Lines analyzed = 1210 in approximately 0.12 seconds (9726 lines/second) Physical Source Lines of Code (SLOC) = 766 Hits@level = [0] 4 [1] 1 [2] 3 [3] 6 [4] 0 [5] 0 Hits@level+ = [0+] 14 [1+] 10 [2+] 9 [3+] 6 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 18.2768 [1+] 13.0548 [2+] 11.7493 [3+] 7.8329 [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.