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/bitlbee-mastodon-1.4.4/src/mastodon-http.c Examining data/bitlbee-mastodon-1.4.4/src/mastodon-http.h Examining data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c Examining data/bitlbee-mastodon-1.4.4/src/mastodon-lib.h Examining data/bitlbee-mastodon-1.4.4/src/mastodon.c Examining data/bitlbee-mastodon-1.4.4/src/mastodon.h Examining data/bitlbee-mastodon-1.4.4/src/rot13.c Examining data/bitlbee-mastodon-1.4.4/src/rot13.h FINAL RESULTS: data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:430:2: [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(start, out); data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:341: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 path[64] = "", *s; data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:413: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 out[strlen(in) + 1]; data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:1032: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 from[MAX_STRING] = ""; data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:1484: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 *args[2] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:1498: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 *args[2] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:1656: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 *args[2] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:2244: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 *args[8] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:2482: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 *args[6] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:2599: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 *args[2] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:2632: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 *args[2] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:2652: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 *args[2] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:2684: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 *args[2] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:3116: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 *args[2] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:3520: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 *args[2] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:3590: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 *args[2] = { "limit", "0", }; data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:3678: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 *args[2] = { "limit", "0", }; data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:3720: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 *args[2] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:3759: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 *args[2] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:4162: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 *args[14] = { data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:4315: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 *args[8] = { data/bitlbee-mastodon-1.4.4/src/mastodon.c:306: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 saved_str [handle_sz + 1]; g_stpcpy(saved_str, new_user_name); data/bitlbee-mastodon-1.4.4/src/mastodon.h:152: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 *undo[MASTODON_MAX_UNDO]; /* a small stack of undo statements */ data/bitlbee-mastodon-1.4.4/src/mastodon.h:153: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 *redo[MASTODON_MAX_UNDO]; /* a small stack of redo statements */ data/bitlbee-mastodon-1.4.4/src/mastodon-http.c:46:41: [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 *key_encoded = g_strndup(key, 3 * strlen(key)); data/bitlbee-mastodon-1.4.4/src/mastodon-http.c:49:45: [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 *value_encoded = g_strndup(value, 3 * strlen(value)); data/bitlbee-mastodon-1.4.4/src/mastodon-http.c:53: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(url) != 0) { data/bitlbee-mastodon-1.4.4/src/mastodon-http.c:130:26: [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). strlen(url_arguments), url_arguments); data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:345:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path, s + 1, sizeof(path) - 1); data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:413:11: [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 out[strlen(in) + 1]; data/bitlbee-mastodon-1.4.4/src/mastodon-lib.c:1149: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). int len = strlen(mf->phrase_case_folded); data/bitlbee-mastodon-1.4.4/src/mastodon.c:267:21: [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). size_t handle_sz = strlen(handle); data/bitlbee-mastodon-1.4.4/src/mastodon.c:502: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). strlen(md->oauth2_service->consumer_key) == 0 || strlen(md->oauth2_service->consumer_secret) == 0) { data/bitlbee-mastodon-1.4.4/src/mastodon.c:502:55: [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). strlen(md->oauth2_service->consumer_key) == 0 || strlen(md->oauth2_service->consumer_secret) == 0) { data/bitlbee-mastodon-1.4.4/src/mastodon.c:702:11: [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). wlen = strlen(who); // length of the first word data/bitlbee-mastodon-1.4.4/src/mastodon.c:1563:19: [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 (!cmd[2] || strlen(cmd[2]) == 0) { ANALYSIS SUMMARY: Hits = 36 Lines analyzed = 6680 in approximately 0.18 seconds (37555 lines/second) Physical Source Lines of Code (SLOC) = 4726 Hits@level = [0] 0 [1] 12 [2] 23 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 36 [1+] 36 [2+] 24 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 7.61744 [1+] 7.61744 [2+] 5.07829 [3+] 0.211595 [4+] 0.211595 [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.