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/kanatest-0.4.8/src/i18n.h Examining data/kanatest-0.4.8/src/test.h Examining data/kanatest-0.4.8/src/graphics.h Examining data/kanatest-0.4.8/src/gui.h Examining data/kanatest-0.4.8/src/options.h Examining data/kanatest-0.4.8/src/about.h Examining data/kanatest-0.4.8/src/chart.h Examining data/kanatest-0.4.8/src/stock_icons_data.h Examining data/kanatest-0.4.8/src/stock_icons.h Examining data/kanatest-0.4.8/src/main.c Examining data/kanatest-0.4.8/src/prefs.c Examining data/kanatest-0.4.8/src/stats.h Examining data/kanatest-0.4.8/src/stock_icons.c Examining data/kanatest-0.4.8/src/main.h Examining data/kanatest-0.4.8/src/gui_utils.h Examining data/kanatest-0.4.8/src/prefs.h Examining data/kanatest-0.4.8/src/about.c Examining data/kanatest-0.4.8/src/chart.c Examining data/kanatest-0.4.8/src/gui.c Examining data/kanatest-0.4.8/src/gui_utils.c Examining data/kanatest-0.4.8/src/options.c Examining data/kanatest-0.4.8/src/stats.c Examining data/kanatest-0.4.8/src/test.c FINAL RESULTS: data/kanatest-0.4.8/src/about.c:229:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buffer, "Kanatest %s\n", VERSION); data/kanatest-0.4.8/src/gui.c:446:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (buffer, "Kanatest %s", VERSION); data/kanatest-0.4.8/src/main.c:67:45: [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. g_snprintf (buffer, PATH_MAX, "%s%c%s", g_get_home_dir(), G_DIR_SEPARATOR, CONFIG_DIRNAME); data/kanatest-0.4.8/src/prefs.c:36:46: [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. g_snprintf (dirname, PATH_MAX, "%s%c%s", g_get_home_dir(), G_DIR_SEPARATOR, config_dirname); data/kanatest-0.4.8/src/test.c:302:15: [3] (random) lrand48: 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. pos = lrand48() % (i+1); data/kanatest-0.4.8/src/about.c:231:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (buffer, "Kanatest SVN r%d\n", REV); data/kanatest-0.4.8/src/gui.c:448:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf (buffer, "Kanatest SVN r%d", REV); data/kanatest-0.4.8/src/stats.c:822:55: [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). entry->date_day = atoi ((gchar *) key); data/kanatest-0.4.8/src/stats.c:828:57: [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). entry->date_month = atoi ((gchar *) key); data/kanatest-0.4.8/src/stats.c:834:56: [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). entry->date_year = atoi ((gchar *) key); data/kanatest-0.4.8/src/stats.c:840:56: [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). entry->date_hour = atoi ((gchar *) key); data/kanatest-0.4.8/src/stats.c:846:58: [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). entry->date_minute = atoi ((gchar *) key); data/kanatest-0.4.8/src/stats.c:852:56: [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). entry->test_time = atoi ((gchar *) key); data/kanatest-0.4.8/src/stats.c:858:56: [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). entry->test_mode = atoi ((gchar *) key); data/kanatest-0.4.8/src/stats.c:864:60: [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). entry->test_kana_set = atoi ((gchar *) key); data/kanatest-0.4.8/src/stats.c:870:61: [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). entry->test_questions = atoi ((gchar *) key); data/kanatest-0.4.8/src/stats.c:876:67: [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). entry->test_correct_answers = atoi ((gchar *) key); data/kanatest-0.4.8/src/stats.c:882:61: [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). entry->test_repeat_mode = (!atoi ((gchar *) key)?REPEAT_NONE:REPEAT_WRONG); data/kanatest-0.4.8/src/stats.c:889:59: [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). entry->test_repeat_mode = atoi ((gchar *) key); data/kanatest-0.4.8/src/stats.c:928:37: [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). count = atoi (prop); data/kanatest-0.4.8/src/stats.c:933:39: [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). correct = atoi (prop); data/kanatest-0.4.8/src/stats.c:938:34: [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). id = atoi (prop); data/kanatest-0.4.8/src/stats.c:966:37: [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). count = atoi (prop); data/kanatest-0.4.8/src/stats.c:971:39: [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). correct = atoi (prop); data/kanatest-0.4.8/src/stats.c:976:34: [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). id = atoi (prop); data/kanatest-0.4.8/src/about.c:266: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). if (strlen(translators[i*3+0])) { data/kanatest-0.4.8/src/gui.c:355:17: [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 ((gchar*)gtk_entry_get_text (GTK_ENTRY(appGUI->romaji_entry)))) { data/kanatest-0.4.8/src/gui_utils.c:397: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). for(i=n=0; i < strlen(link); i++) { data/kanatest-0.4.8/src/options.c:60:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(config.kana_font_face, s, MAX_FONTNAME_LEN); ANALYSIS SUMMARY: Hits = 29 Lines analyzed = 13208 in approximately 1.91 seconds (6906 lines/second) Physical Source Lines of Code (SLOC) = 11319 Hits@level = [0] 23 [1] 4 [2] 20 [3] 3 [4] 2 [5] 0 Hits@level+ = [0+] 52 [1+] 29 [2+] 25 [3+] 5 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 4.59405 [1+] 2.56206 [2+] 2.20868 [3+] 0.441735 [4+] 0.176694 [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.