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/bip-0.9.0~rc4/tests/check_line.c Examining data/bip-0.9.0~rc4/src/bip_main.c Examining data/bip-0.9.0~rc4/src/md5.h Examining data/bip-0.9.0~rc4/src/util.c Examining data/bip-0.9.0~rc4/src/connection.h Examining data/bip-0.9.0~rc4/src/lex.c Examining data/bip-0.9.0~rc4/src/bipmkpw.c Examining data/bip-0.9.0~rc4/src/connection.c Examining data/bip-0.9.0~rc4/src/bip.h Examining data/bip-0.9.0~rc4/src/md5.c Examining data/bip-0.9.0~rc4/src/log.c Examining data/bip-0.9.0~rc4/src/line.h Examining data/bip-0.9.0~rc4/src/line.c Examining data/bip-0.9.0~rc4/src/tuple.h Examining data/bip-0.9.0~rc4/src/util.h Examining data/bip-0.9.0~rc4/src/conf.c Examining data/bip-0.9.0~rc4/src/log.h Examining data/bip-0.9.0~rc4/src/bip.c Examining data/bip-0.9.0~rc4/src/conf.h Examining data/bip-0.9.0~rc4/src/irc.c Examining data/bip-0.9.0~rc4/src/irc.h Examining data/bip-0.9.0~rc4/src/defaults.h Examining data/bip-0.9.0~rc4/src/path_util.h Examining data/bip-0.9.0~rc4/src/path_util.c FINAL RESULTS: data/bip-0.9.0~rc4/src/bip.c:144:7: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. n = vsnprintf(error, size, fmt, ap); data/bip-0.9.0~rc4/src/bip.c:1632:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(str, 4095, fmt, ap); data/bip-0.9.0~rc4/src/bip_main.c:217: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(conf_biphome, home); data/bip-0.9.0~rc4/src/bip_main.c:224: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(bip.oidentdpath, conf_biphome); data/bip-0.9.0~rc4/src/bip_main.c:226:3: [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(bip.oidentdpath, OIDENTD_FILENAME); data/bip-0.9.0~rc4/src/bip_main.c:232: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(confpath, conf_biphome); data/bip-0.9.0~rc4/src/bip_main.c:234:3: [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(confpath, S_CONF); data/bip-0.9.0~rc4/src/bip_main.c:249: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(conf_log_root, conf_biphome); data/bip-0.9.0~rc4/src/bip_main.c:250:3: [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(conf_log_root, ap); data/bip-0.9.0~rc4/src/bip_main.c:257: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(conf_pid_file, conf_biphome); data/bip-0.9.0~rc4/src/bip_main.c:258:3: [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(conf_pid_file, pid); data/bip-0.9.0~rc4/src/conf.c:1007:21: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define YYFPRINTF fprintf data/bip-0.9.0~rc4/src/irc.c:142:3: [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(str, nick); data/bip-0.9.0~rc4/src/irc.c:251:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(str, "%s\r\n", (char *)list_it_item(&itocs)); data/bip-0.9.0~rc4/src/irc.c:285: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(ircmask, nick); data/bip-0.9.0~rc4/src/irc.c:287:3: [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(ircmask, iname); data/bip-0.9.0~rc4/src/irc.c:289:3: [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(ircmask, ihost); data/bip-0.9.0~rc4/src/irc.c:394:4: [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(newnick, server->nick); data/bip-0.9.0~rc4/src/irc.c:534: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(ircmask, LINK(ic)->l_server->nick); data/bip-0.9.0~rc4/src/irc.c:535:2: [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(ircmask, BIP_FAKEMASK); data/bip-0.9.0~rc4/src/irc.c:1918: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(ircs->ircmask, nick); data/bip-0.9.0~rc4/src/irc.c:1919:3: [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(ircs->ircmask, eom); data/bip-0.9.0~rc4/src/irc.c:1925: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(ircs->ircmask, nick); data/bip-0.9.0~rc4/src/irc.c:1926:2: [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(ircs->ircmask, BIP_FAKEMASK); data/bip-0.9.0~rc4/src/irc.c:2334:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(f, BIP_OIDENTD_START); data/bip-0.9.0~rc4/src/irc.c:2349:3: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(f, BIP_OIDENTD_END); data/bip-0.9.0~rc4/src/line.c:90:3: [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(ret, l->origin); data/bip-0.9.0~rc4/src/line.c:94:3: [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(ret, array_get(&l->words, i)); data/bip-0.9.0~rc4/src/line.c:100:2: [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(ret, array_get(&l->words, i)); data/bip-0.9.0~rc4/src/log.c:229:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%s.%d", filename, i); data/bip-0.9.0~rc4/src/log.c:920: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(p, LAMESTRING); data/bip-0.9.0~rc4/src/log.c:937: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(p, PMSG_ARROW); data/bip-0.9.0~rc4/src/path_util.c:23: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(conf_file, biphome); data/bip-0.9.0~rc4/src/path_util.c:26:2: [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(conf_file, filename); data/bip-0.9.0~rc4/src/util.c:191:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(conf_global_log_file, fmt, ap); data/bip-0.9.0~rc4/src/bip_main.c:182:15: [3] (buffer) getopt: 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. while ((ch = getopt(argc, argv, "hvnf:s:")) != -1) { data/bip-0.9.0~rc4/src/bip_main.c:208:9: [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. home = getenv("HOME"); data/bip-0.9.0~rc4/src/bipmkpw.c:88:2: [3] (random) srand: 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. srand(time(NULL)); data/bip-0.9.0~rc4/src/bip.c:165: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 hname[512]; data/bip-0.9.0~rc4/src/bip.c:174:6: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(conf_pid_file, "r"); data/bip-0.9.0~rc4/src/bip.c:183:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(longpath, O_CREAT|O_WRONLY, S_IWUSR|S_IRUSR)) == -1) data/bip-0.9.0~rc4/src/bip.c:190:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(conf_pid_file, "r"); data/bip-0.9.0~rc4/src/bip.c:1135: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 buf[RET_STR_LEN + 1]; data/bip-0.9.0~rc4/src/bip.c:1312: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 buf[RET_STR_LEN + 1]; data/bip-0.9.0~rc4/src/bip.c:1373: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 buf[RET_STR_LEN + 1]; data/bip-0.9.0~rc4/src/bip.c:1420: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 buf[RET_STR_LEN + 1]; data/bip-0.9.0~rc4/src/bip.c:1501: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 subject[270]; data/bip-0.9.0~rc4/src/bip.c:1502: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 issuer[270]; data/bip-0.9.0~rc4/src/bip.c:1503:11: [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. unsigned char fp[EVP_MAX_MD_SIZE]; data/bip-0.9.0~rc4/src/bip.c:1504: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 fpstr[EVP_MAX_MD_SIZE * 3 + 20]; data/bip-0.9.0~rc4/src/bip.c:1515:2: [2] (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). Risk is low because the source is a constant string. strcpy(subject, "Subject: "); data/bip-0.9.0~rc4/src/bip.c:1516:2: [2] (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). Risk is low because the source is a constant string. strcpy(issuer, "Issuer: "); data/bip-0.9.0~rc4/src/bip.c:1517:2: [2] (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). Risk is low because the source is a constant string. strcpy(fpstr, "MD5 fingerprint: "); data/bip-0.9.0~rc4/src/bip.c:1523:3: [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(fpstr + 17 + (i * 3), "%02X%c", data/bip-0.9.0~rc4/src/bip.c:1625: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 str[4096]; data/bip-0.9.0~rc4/src/bip.c:1703: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 buf[ON_CONNECT_MAX_STRSIZE]; data/bip-0.9.0~rc4/src/bip.c:1889:4: [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(elemstr, ptr, slen); data/bip-0.9.0~rc4/src/bip.c:1897:4: [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(elemstr, ptr, slen); data/bip-0.9.0~rc4/src/bip.c:2035: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). int hours = atoi(irc_line_elem(line, privmsg + 2)); data/bip-0.9.0~rc4/src/bip_main.c:96: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 buf[4096]; data/bip-0.9.0~rc4/src/bip_main.c:102:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *f = fopen(buf, "a"); data/bip-0.9.0~rc4/src/bip_main.c:150: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 buf[30]; data/bip-0.9.0~rc4/src/bip_main.c:218: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(conf_biphome, "/.bip"); data/bip-0.9.0~rc4/src/bip_main.c:236:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). conf = fopen(confpath, "r"); data/bip-0.9.0~rc4/src/bip_main.c:310:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). conf = fopen(confpath, "r"); data/bip-0.9.0~rc4/src/bipmkpw.c:31:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int ttyfd = open("/dev/tty", O_RDWR); data/bip-0.9.0~rc4/src/bipmkpw.c:44:2: [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(&tt, &ttback, sizeof(ttback)); data/bip-0.9.0~rc4/src/bipmkpw.c:80:9: [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. static char str[256]; data/bip-0.9.0~rc4/src/conf.c:1257: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 const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; data/bip-0.9.0~rc4/src/conf.c:1452: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 yymsgbuf[128]; data/bip-0.9.0~rc4/src/connection.c:177: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 ip[256]; data/bip-0.9.0~rc4/src/connection.c:563:4: [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(buf, p + lastlen, ssz); data/bip-0.9.0~rc4/src/connection.c:1141:11: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((f = fopen(conf_client_dh_file, "r")) == NULL) { data/bip-0.9.0~rc4/src/connection.c:1261: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 portbuf[20]; data/bip-0.9.0~rc4/src/connection.c:1291: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 buf[1025]; data/bip-0.9.0~rc4/src/connection.c:1304:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/random", flags); data/bip-0.9.0~rc4/src/connection.c:1356: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 subject[256]; data/bip-0.9.0~rc4/src/connection.c:1357: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 issuer[256]; data/bip-0.9.0~rc4/src/connection.c:1458: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 buf[128]; data/bip-0.9.0~rc4/src/connection.c:1633: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 dstportbuf[20], srcportbuf[20], *tmp; data/bip-0.9.0~rc4/src/irc.c:101:2: [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(ret, mask, len); data/bip-0.9.0~rc4/src/irc.c:549: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 tmptype[2]; data/bip-0.9.0~rc4/src/irc.c:634:3: [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(ret, cur, c - cur); data/bip-0.9.0~rc4/src/irc.c:643:3: [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(ret, cur, c - cur); data/bip-0.9.0~rc4/src/irc.c:1042:3: [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(p, s, len); data/bip-0.9.0~rc4/src/irc.c:1051:5: [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(kp, ks, klen); data/bip-0.9.0~rc4/src/irc.c:1411:3: [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(nick, names, len); data/bip-0.9.0~rc4/src/irc.c:2129:2: [2] (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). Risk is low because the source is a constant string. strcpy(s->prefixes, "@+"); data/bip-0.9.0~rc4/src/irc.c:2130:2: [2] (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). Risk is low because the source is a constant string. strcpy(s->usermodes, "ov"); data/bip-0.9.0~rc4/src/irc.c:2255:31: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (errno == ENOENT && (f = fopen(bip->oidentdpath, "w+"))) { data/bip-0.9.0~rc4/src/irc.c:2265:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(bip->oidentdpath, "r+"); data/bip-0.9.0~rc4/src/irc.c:2668:4: [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(dup, modes, len); data/bip-0.9.0~rc4/src/irc.c:2705:2: [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(s->usermodes, modes + 1, len); data/bip-0.9.0~rc4/src/irc.c:2707:2: [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(s->prefixes, end_mode + 1, len); data/bip-0.9.0~rc4/src/lex.c:1073:21: [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). yylval.number = atoi(yytext); data/bip-0.9.0~rc4/src/lex.c:1378:5: [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(yylval.string, yytext + 1, len); data/bip-0.9.0~rc4/src/line.c:101:2: [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(ret, "\r\n"); data/bip-0.9.0~rc4/src/line.c:169:3: [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(line->origin, str + 1, len); data/bip-0.9.0~rc4/src/line.c:192:3: [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(tmp, str, len); data/bip-0.9.0~rc4/src/log.c:131:3: [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(pos, value, lenval); data/bip-0.9.0~rc4/src/log.c:137: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 *logfile, year[5], day[3], month[3], hour[3], *tmp, *logdir; data/bip-0.9.0~rc4/src/log.c:274:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). f = fopen(uniq_fname, "a+"); data/bip-0.9.0~rc4/src/log.c:595:12: [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). seconds = atoi(when); data/bip-0.9.0~rc4/src/log.c:773:15: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). lf->file = fopen(lf->filename, "r"); data/bip-0.9.0~rc4/src/log.c:917:2: [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(p, son, lon); data/bip-0.9.0~rc4/src/log.c:923:2: [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(p, dest, strlen(dest)); data/bip-0.9.0~rc4/src/log.c:933:3: [2] (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). Risk is low because the source is a constant string. strcpy(p, "ACTION "); data/bip-0.9.0~rc4/src/log.c:941:3: [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(p, sots, lots); data/bip-0.9.0~rc4/src/log.c:947:2: [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(p, som, lom); data/bip-0.9.0~rc4/src/log.c:983:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). lf->file = fopen(lf->filename, "r"); data/bip-0.9.0~rc4/src/log.c:1128:9: [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. static char tmpstr[LOGLINE_MAXLEN + 1]; data/bip-0.9.0~rc4/src/log.c:1256:4: [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(extracted, start, len); data/bip-0.9.0~rc4/src/log.c:1279:11: [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). *year = atoi(array_get(fields, 2)); data/bip-0.9.0~rc4/src/log.c:1280:12: [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). *month = atoi(array_get(fields, 1)); data/bip-0.9.0~rc4/src/log.c:1281:11: [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). *mday = atoi(array_get(fields, 0)); data/bip-0.9.0~rc4/src/log.c:1282:11: [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). *hour = atoi(array_get(fields, 3)); data/bip-0.9.0~rc4/src/log.c:1283:10: [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). *min = atoi(array_get(fields, 4)); data/bip-0.9.0~rc4/src/log.c:1284:10: [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). *sec = atoi(array_get(fields, 5)); data/bip-0.9.0~rc4/src/md5.c:194: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( (void *) (ctx->buffer + left), data/bip-0.9.0~rc4/src/md5.c:211: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( (void *) (ctx->buffer + left), data/bip-0.9.0~rc4/src/md5.c:285: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 output[33]; data/bip-0.9.0~rc4/src/md5.c:287:14: [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. unsigned char buf[1000]; data/bip-0.9.0~rc4/src/md5.c:288:14: [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. unsigned char md5sum[16]; data/bip-0.9.0~rc4/src/md5.c:304:17: [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( output + j * 2, "%02x", md5sum[j] ); data/bip-0.9.0~rc4/src/md5.c:320:21: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if( ! ( f = fopen( argv[1], "rb" ) ) ) data/bip-0.9.0~rc4/src/md5.c:366:2: [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(ptr + 4, str, length - 4); data/bip-0.9.0~rc4/src/md5.c:369:2: [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(md5, ptr, 4); data/bip-0.9.0~rc4/src/util.c:118:9: [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. static char ts[20]; data/bip-0.9.0~rc4/src/util.c:131:9: [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. static char ts[20]; data/bip-0.9.0~rc4/src/bip.c:78: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(hex) != 40) data/bip-0.9.0~rc4/src/bip.c:169: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). int longpath_max = strlen(conf_pid_file) + 512 + 3 + 20; data/bip-0.9.0~rc4/src/bip.c:1881:24: [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). elemstr = bip_malloc(strlen(linestr) + 1); data/bip-0.9.0~rc4/src/bip.c:1894:16: [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). eptr = ptr + strlen(ptr); data/bip-0.9.0~rc4/src/bip_main.c:203:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(0027); data/bip-0.9.0~rc4/src/bip_main.c:216:29: [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). conf_biphome = bip_malloc(strlen(home) + strlen("/.bip") + 1); data/bip-0.9.0~rc4/src/bip_main.c:216:44: [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). conf_biphome = bip_malloc(strlen(home) + strlen("/.bip") + 1); data/bip-0.9.0~rc4/src/bip_main.c:222:32: [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). bip.oidentdpath = bip_malloc(strlen(conf_biphome) + 1 + data/bip-0.9.0~rc4/src/bip_main.c:223:5: [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(OIDENTD_FILENAME) + 1); data/bip-0.9.0~rc4/src/bip_main.c:225:3: [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(bip.oidentdpath, "/"); data/bip-0.9.0~rc4/src/bip_main.c:230:25: [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). confpath = bip_malloc(strlen(conf_biphome) + 1 + data/bip-0.9.0~rc4/src/bip_main.c:231:5: [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(S_CONF) + 1); data/bip-0.9.0~rc4/src/bip_main.c:233:3: [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(confpath, "/"); data/bip-0.9.0~rc4/src/bip_main.c:247:30: [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). conf_log_root = bip_malloc(strlen(conf_biphome) + data/bip-0.9.0~rc4/src/bip_main.c:248:5: [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(ap) + 1); data/bip-0.9.0~rc4/src/bip_main.c:255:30: [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). conf_pid_file = bip_malloc(strlen(conf_biphome) + data/bip-0.9.0~rc4/src/bip_main.c:256:5: [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(pid) + 1); data/bip-0.9.0~rc4/src/bip_main.c:298: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). write(fd, buf, strlen(buf)); data/bip-0.9.0~rc4/src/bipmkpw.c:56:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(ttyfd, buffer+idx, 1); data/bip-0.9.0~rc4/src/conf.c:1155:47: [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). # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) data/bip-0.9.0~rc4/src/connection.c:211:22: [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 = sizeof(char)*strlen(message); data/bip-0.9.0~rc4/src/connection.c:298:9: [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 = strlen(message); data/bip-0.9.0~rc4/src/connection.c:522:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). count = read(cn->handle, cn->incoming+cn->incoming_end, data/bip-0.9.0~rc4/src/connection.c:1312:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, buf, 1024); data/bip-0.9.0~rc4/src/connection.c:1463:9: [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). len = strlen(buf); data/bip-0.9.0~rc4/src/irc.c:122:10: [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). assert(strlen(nick) + 2 < NAMESIZE); data/bip-0.9.0~rc4/src/irc.c:124: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 (len + strlen(nick) + 2 + (ovmask ? 1 : 0) >= NAMESIZE) { data/bip-0.9.0~rc4/src/irc.c:131:4: [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(str, " "); data/bip-0.9.0~rc4/src/irc.c:143:10: [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). len += strlen(nick); data/bip-0.9.0~rc4/src/irc.c:249: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). ssize_t len = strlen(list_it_item(&itocs)) + 2; data/bip-0.9.0~rc4/src/irc.c:283:30: [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 *ircmask = bip_malloc(strlen(nick) + strlen(iname) + data/bip-0.9.0~rc4/src/irc.c:283: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 *ircmask = bip_malloc(strlen(nick) + strlen(iname) + data/bip-0.9.0~rc4/src/irc.c:284:5: [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(ihost) + 3); data/bip-0.9.0~rc4/src/irc.c:286:3: [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(ircmask, "!"); data/bip-0.9.0~rc4/src/irc.c:288:3: [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(ircmask, "@"); data/bip-0.9.0~rc4/src/irc.c:391: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 nicklen = strlen(server->nick); data/bip-0.9.0~rc4/src/irc.c:395:8: [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(server->nick) < 9) { data/bip-0.9.0~rc4/src/irc.c:396:5: [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(newnick, "`"); data/bip-0.9.0~rc4/src/irc.c:532:23: [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). ircmask = bip_malloc(strlen(LINK(ic)->l_server->nick) + data/bip-0.9.0~rc4/src/irc.c:533:4: [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(BIP_FAKEMASK) + 1); data/bip-0.9.0~rc4/src/irc.c:639: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). c = str + strlen(str); data/bip-0.9.0~rc4/src/irc.c:1045:8: [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(ks)) { data/bip-0.9.0~rc4/src/irc.c:1048:16: [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). ke = ks + strlen(ks); data/bip-0.9.0~rc4/src/irc.c:1201:15: [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 len = strlen(irc_line_elem(line, 2)) + 5; data/bip-0.9.0~rc4/src/irc.c:1917:30: [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). ircs->ircmask = bip_malloc(strlen(nick) + strlen(eom) + 1); data/bip-0.9.0~rc4/src/irc.c:1917: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). ircs->ircmask = bip_malloc(strlen(nick) + strlen(eom) + 1); data/bip-0.9.0~rc4/src/irc.c:1924:29: [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). ircs->ircmask = bip_malloc(strlen(nick) + strlen(BIP_FAKEMASK) + 1); data/bip-0.9.0~rc4/src/irc.c:1924:44: [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). ircs->ircmask = bip_malloc(strlen(nick) + strlen(BIP_FAKEMASK) + 1); data/bip-0.9.0~rc4/src/irc.c:2240:32: [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). #define BIP_OIDENTD_END_LENGTH strlen(BIP_OIDENTD_END) data/bip-0.9.0~rc4/src/irc.c:2666: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). len = strlen(modes); // last piece data/bip-0.9.0~rc4/src/irc.c:2697: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). if (len * 2 + 2 != strlen(modes)) { data/bip-0.9.0~rc4/src/lex.c:884:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ data/bip-0.9.0~rc4/src/lex.c:1376: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). size_t len = strlen(yytext) - 2; data/bip-0.9.0~rc4/src/lex.c:2135:37: [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). return yy_scan_bytes( yystr, (int) strlen(yystr) ); data/bip-0.9.0~rc4/src/line.c:80:9: [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). len = strlen(l->origin) + 2; data/bip-0.9.0~rc4/src/line.c:82:10: [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). len += strlen(array_get(&l->words, i)) + 1; data/bip-0.9.0~rc4/src/line.c:89:3: [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(ret, ":"); data/bip-0.9.0~rc4/src/line.c:91:3: [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(ret, " "); data/bip-0.9.0~rc4/src/line.c:95:3: [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(ret, " "); data/bip-0.9.0~rc4/src/line.c:98:3: [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(ret, ":"); data/bip-0.9.0~rc4/src/log.c:77:12: [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(dirname); data/bip-0.9.0~rc4/src/log.c:86:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(dir + count, "/", 2); data/bip-0.9.0~rc4/src/log.c:93:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dir + count, tmp, pos); data/bip-0.9.0~rc4/src/log.c:123:24: [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). unsigned int lenvar = strlen(var); data/bip-0.9.0~rc4/src/log.c:124:24: [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). unsigned int lenval = strlen(value); data/bip-0.9.0~rc4/src/log.c:128:7: [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(str) + lenval - lenvar >= max) data/bip-0.9.0~rc4/src/log.c:130: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). memmove(pos + lenval, pos + lenvar, strlen(pos + lenvar) + 1); data/bip-0.9.0~rc4/src/log.c:227: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). char *buf = bip_malloc(strlen(filename) + 4 + 1); data/bip-0.9.0~rc4/src/log.c:506: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(message) > 8 && ((*message == '\001' || data/bip-0.9.0~rc4/src/log.c:509:16: [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). (*(message + strlen(message) - 1) == '\001'))) { data/bip-0.9.0~rc4/src/log.c:520: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). *(msg + strlen(msg) - 1) = '\0'; data/bip-0.9.0~rc4/src/log.c:787:15: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(lf->file)) != EOF) { data/bip-0.9.0~rc4/src/log.c:902:9: [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). lon = strlen(storename); data/bip-0.9.0~rc4/src/log.c:906:8: [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). lom = strlen(p); data/bip-0.9.0~rc4/src/log.c:911: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). 1 + lon + strlen(LAMESTRING) + strlen(dest) + 2 + lots + 2 + data/bip-0.9.0~rc4/src/log.c:911:34: [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). 1 + lon + strlen(LAMESTRING) + strlen(dest) + 2 + lots + 2 + data/bip-0.9.0~rc4/src/log.c:912:27: [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). lom + 3 + action * (2 + strlen("ACTION ")) + data/bip-0.9.0~rc4/src/log.c:913:9: [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). out * strlen(PMSG_ARROW)); data/bip-0.9.0~rc4/src/log.c:921:7: [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). p += strlen(LAMESTRING); data/bip-0.9.0~rc4/src/log.c:923: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). memcpy(p, dest, strlen(dest)); data/bip-0.9.0~rc4/src/log.c:924:7: [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). p += strlen(dest); data/bip-0.9.0~rc4/src/log.c:934:8: [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). p += strlen("ACTION "); data/bip-0.9.0~rc4/src/log.c:938:8: [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). p += strlen(PMSG_ARROW); data/bip-0.9.0~rc4/src/log.c:1026:14: [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 slen = strlen(buf); data/bip-0.9.0~rc4/src/log.c:1130:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tmpstr, str, LOGLINE_MAXLEN); data/bip-0.9.0~rc4/src/log.c:1150:8: [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). len = strlen(tmpstr); data/bip-0.9.0~rc4/src/md5.c:299:49: [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). md5_update( &ctx, (uint8 *) msg[i], strlen( msg[i] ) ); data/bip-0.9.0~rc4/src/md5.c:359: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). length = strlen(str); data/bip-0.9.0~rc4/src/path_util.c:22:25: [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). conf_file = bip_malloc(strlen(biphome) + strlen(filename) + 2); data/bip-0.9.0~rc4/src/path_util.c:22:43: [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). conf_file = bip_malloc(strlen(biphome) + strlen(filename) + 2); data/bip-0.9.0~rc4/src/path_util.c:24:12: [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). conf_file[strlen(biphome)] = '/'; data/bip-0.9.0~rc4/src/path_util.c:25:12: [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). conf_file[strlen(biphome) + 1] = '\0'; data/bip-0.9.0~rc4/src/util.c:38: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). fwrite(OOMMSG, 1, strlen(OOMMSG), conf_global_log_file); ANALYSIS SUMMARY: Hits = 222 Lines analyzed = 16110 in approximately 0.40 seconds (39922 lines/second) Physical Source Lines of Code (SLOC) = 12755 Hits@level = [0] 87 [1] 93 [2] 91 [3] 3 [4] 35 [5] 0 Hits@level+ = [0+] 309 [1+] 222 [2+] 129 [3+] 38 [4+] 35 [5+] 0 Hits/KSLOC@level+ = [0+] 24.2258 [1+] 17.4049 [2+] 10.1137 [3+] 2.97922 [4+] 2.74402 [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.