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/grig-0.8.1/src/rig-gui-func.c Examining data/grig-0.8.1/src/rig-gui-tx.h Examining data/grig-0.8.1/src/grig-debug.c Examining data/grig-0.8.1/src/radio-conf.h Examining data/grig-0.8.1/src/rig-selector.h Examining data/grig-0.8.1/src/rig-gui-buttons.c Examining data/grig-0.8.1/src/grig-debug.h Examining data/grig-0.8.1/src/grig-about.h Examining data/grig-0.8.1/src/rig-gui-vfo.h Examining data/grig-0.8.1/src/rig-gui-keypad.h Examining data/grig-0.8.1/src/rig-gui-levels.h Examining data/grig-0.8.1/src/rig-gui.h Examining data/grig-0.8.1/src/key-press-handler.h Examining data/grig-0.8.1/src/rig-daemon-check.c Examining data/grig-0.8.1/src/rig-gui-info.h Examining data/grig-0.8.1/src/rig-gui-message-window.h Examining data/grig-0.8.1/src/compat.c Examining data/grig-0.8.1/src/rig-utils.h Examining data/grig-0.8.1/src/rig-gui-smeter-conv.c Examining data/grig-0.8.1/src/rig-daemon-check.h Examining data/grig-0.8.1/src/rig-gui-ctrl2.h Examining data/grig-0.8.1/src/rig-anomaly.h Examining data/grig-0.8.1/src/rig-state.c Examining data/grig-0.8.1/src/rig-daemon.h Examining data/grig-0.8.1/src/grig-about.c Examining data/grig-0.8.1/src/grig-config.h Examining data/grig-0.8.1/src/rig-utils.c Examining data/grig-0.8.1/src/rig-state.h Examining data/grig-0.8.1/src/grig-menubar.h Examining data/grig-0.8.1/src/rig-data.c Examining data/grig-0.8.1/src/rig-gui-message-window.c Examining data/grig-0.8.1/src/rig-gui-lcd.c Examining data/grig-0.8.1/src/rig-gui.c Examining data/grig-0.8.1/src/grig-config.c Examining data/grig-0.8.1/src/rig-gui-rx.h Examining data/grig-0.8.1/src/rig-gui-func.h Examining data/grig-0.8.1/src/rig-gui-info-data.h Examining data/grig-0.8.1/src/main.c Examining data/grig-0.8.1/src/rig-gui-ctrl2.c Examining data/grig-0.8.1/src/rig-gui-keypad.c Examining data/grig-0.8.1/src/rig-gui-smeter.c Examining data/grig-0.8.1/src/grig-gtk-workarounds.h Examining data/grig-0.8.1/src/rig-gui-rx.c Examining data/grig-0.8.1/src/rig-anomaly.c Examining data/grig-0.8.1/src/compat.h Examining data/grig-0.8.1/src/rig-gui-smeter-conv.h Examining data/grig-0.8.1/src/rig-gui-vfo.c Examining data/grig-0.8.1/src/rig-gui-smeter.h Examining data/grig-0.8.1/src/rig-gui-lcd.h Examining data/grig-0.8.1/src/rig-gui-info.c Examining data/grig-0.8.1/src/rig-gui-buttons.h Examining data/grig-0.8.1/src/rig-selector.c Examining data/grig-0.8.1/src/rig-gui-tx.c Examining data/grig-0.8.1/src/rig-data.h Examining data/grig-0.8.1/src/grig-gtk-workarounds.c Examining data/grig-0.8.1/src/radio-conf.c Examining data/grig-0.8.1/src/key-press-handler.c Examining data/grig-0.8.1/src/rig-gui-levels.c Examining data/grig-0.8.1/src/grig-menubar.c Examining data/grig-0.8.1/src/rig-daemon.c FINAL RESULTS: data/grig-0.8.1/src/compat.c:151:28: [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_strconcat (g_get_home_dir(), G_DIR_SEPARATOR_S, data/grig-0.8.1/src/compat.c:156:28: [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_strconcat (g_get_home_dir(), G_DIR_SEPARATOR_S, data/grig-0.8.1/src/grig-config.c:95:21: [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_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S, ".grig", NULL); data/grig-0.8.1/src/grig-config.c:150:25: [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. dirname = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S, ".grig", NULL); data/grig-0.8.1/src/main.c:201:7: [3] (buffer) getopt_long: 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. c = getopt_long (argc, argv, SHORT_OPTIONS, data/grig-0.8.1/src/radio-conf.c:67: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. fname = g_strconcat (g_get_home_dir(), G_DIR_SEPARATOR_S, data/grig-0.8.1/src/radio-conf.c:131: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. fname = g_strconcat (g_get_home_dir(), G_DIR_SEPARATOR_S, data/grig-0.8.1/src/rig-gui-smeter.c:253:21: [3] (random) g_random_int_range: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. db = (gint) g_random_int_range (-100, 100); data/grig-0.8.1/src/rig-gui-smeter.c:274:29: [3] (random) g_random_double_range: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. valf = (gfloat) g_random_double_range (0.8, 1.5); data/grig-0.8.1/src/rig-gui-smeter.c:294:29: [3] (random) g_random_double_range: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. valf = (gfloat) g_random_double_range (0.1, 0.15); data/grig-0.8.1/src/rig-gui-smeter.c:304:29: [3] (random) g_random_double_range: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. valf = (gfloat) g_random_double_range (-0.5, 0.3); data/grig-0.8.1/src/rig-selector.c:314:28: [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. dirname = g_strconcat (g_get_home_dir (), G_DIR_SEPARATOR_S, data/grig-0.8.1/src/rig-selector.c:469: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. fname = g_strconcat (g_get_home_dir(), G_DIR_SEPARATOR_S, data/grig-0.8.1/src/main.c:215:14: [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). rignum = atoi (optarg); data/grig-0.8.1/src/main.c:235:16: [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). rigspeed = atoi (optarg); data/grig-0.8.1/src/main.c:270:13: [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). debug = atoi (optarg); data/grig-0.8.1/src/main.c:280:13: [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). delay = atoi (optarg); data/grig-0.8.1/src/rig-daemon.c:540:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (myrig->state.rigport.pathname, rigport, FILPATHLEN); data/grig-0.8.1/src/rig-gui-func.c:209:39: [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 (rig_data_has_set_func (func) && strlen(funcstr) != 0) { ANALYSIS SUMMARY: Hits = 19 Lines analyzed = 20876 in approximately 0.55 seconds (38069 lines/second) Physical Source Lines of Code (SLOC) = 11216 Hits@level = [0] 1 [1] 2 [2] 4 [3] 13 [4] 0 [5] 0 Hits@level+ = [0+] 20 [1+] 19 [2+] 17 [3+] 13 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 1.78317 [1+] 1.69401 [2+] 1.51569 [3+] 1.15906 [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.