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/ibus-rime-1.4.0/rime_config.h Examining data/ibus-rime-1.4.0/rime_engine.h Examining data/ibus-rime-1.4.0/rime_settings.c Examining data/ibus-rime-1.4.0/rime_engine.c Examining data/ibus-rime-1.4.0/rime_main.c Examining data/ibus-rime-1.4.0/rime_settings.h FINAL RESULTS: data/ibus-rime-1.4.0/rime_main.c:28:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(path, home); data/ibus-rime-1.4.0/rime_main.c:35:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(path, home); data/ibus-rime-1.4.0/rime_main.c:27:22: [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. const char* home = getenv("HOME"); data/ibus-rime-1.4.0/rime_main.c:34:22: [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. const char* home = getenv("HOME"); data/ibus-rime-1.4.0/rime_main.c:29:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(path, "/.config/ibus/rime"); data/ibus-rime-1.4.0/rime_main.c:36:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(path, "/.ibus/rime"); data/ibus-rime-1.4.0/rime_main.c:179: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 user_data_dir[512] = {0}; data/ibus-rime-1.4.0/rime_main.c:180: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 old_user_data_dir[512] = {0}; data/ibus-rime-1.4.0/rime_engine.c:381:36: [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). context.menu.select_keys ? strlen(context.menu.select_keys) : 0; ANALYSIS SUMMARY: Hits = 9 Lines analyzed = 945 in approximately 0.04 seconds (22671 lines/second) Physical Source Lines of Code (SLOC) = 803 Hits@level = [0] 0 [1] 1 [2] 4 [3] 2 [4] 2 [5] 0 Hits@level+ = [0+] 9 [1+] 9 [2+] 8 [3+] 4 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 11.208 [1+] 11.208 [2+] 9.96264 [3+] 4.98132 [4+] 2.49066 [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.