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/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c Examining data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.h Examining data/fcitx-cloudpinyin-0.3.7/src/cloudpinyinconifg.c Examining data/fcitx-cloudpinyin-0.3.7/src/fetch.c Examining data/fcitx-cloudpinyin-0.3.7/src/fetch.h Examining data/fcitx-cloudpinyin-0.3.7/src/parse.c Examining data/fcitx-cloudpinyin-0.3.7/src/parse.h FINAL RESULTS: data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:910:29: [4] (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). strcat(p + plength, result); data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:925:25: [4] (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). strcat(p + plength, lastpos); data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:575:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&(queue->str[queue->size]), ptr, realsize); data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:869:5: [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 p[MAX_USER_INPUT + 1], *pinyin, *lastpos; data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.h:91:5: [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 key[SOGOU_KEY_LENGTH + 1]; data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:376:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (read(cloudpinyin->pipeRecv, &c, sizeof(char)) > 0); data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:460:46: [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). char* urlstring = curl_escape(strPinyin, strlen(strPinyin)); data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:594:65: [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). HASH_ADD_KEYPTR(hh, cloudpinyin->cache, cacheEntry->pinyin, strlen(cacheEntry->pinyin), cacheEntry); data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:875:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(p, string, hzlength); data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:909: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 (plength + strlen(result) + (engine[cloudpinyin->config.source].supportSeparator ? 1 : 0) < MAX_USER_INPUT) { data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:911:40: [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). plength += strlen(result); data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:913:33: [1] (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 character. strcat(p + plength, "'"); data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:924:35: [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 (plength + strlen(lastpos) + (PINYIN_USE_SEPARATOR_CASE ? 1 : 0) < MAX_USER_INPUT) { data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:926: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). plength += strlen(lastpos); data/fcitx-cloudpinyin-0.3.7/src/cloudpinyin.c:928:29: [1] (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 character. strcat(p + plength, "'"); data/fcitx-cloudpinyin-0.3.7/src/fetch.c:49:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((r = read(fetch->pipeRecv, &c, sizeof(char))) > 0) { data/fcitx-cloudpinyin-0.3.7/src/parse.c:19:18: [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). start += strlen( "\",[\""); data/fcitx-cloudpinyin-0.3.7/src/parse.c:24:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(realstring, start, length); data/fcitx-cloudpinyin-0.3.7/src/parse.c:45:18: [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). start += strlen( "[[\""); data/fcitx-cloudpinyin-0.3.7/src/parse.c:50:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(realstring, start, length); ANALYSIS SUMMARY: Hits = 20 Lines analyzed = 1412 in approximately 0.05 seconds (31073 lines/second) Physical Source Lines of Code (SLOC) = 1085 Hits@level = [0] 1 [1] 15 [2] 3 [3] 0 [4] 2 [5] 0 Hits@level+ = [0+] 21 [1+] 20 [2+] 5 [3+] 2 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 19.3548 [1+] 18.4332 [2+] 4.60829 [3+] 1.84332 [4+] 1.84332 [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.