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/libotr-4.1.1/tests/utils/utils.c Examining data/libotr-4.1.1/tests/utils/tap/tap.h Examining data/libotr-4.1.1/tests/utils/tap/tap.c Examining data/libotr-4.1.1/tests/utils/utils.h Examining data/libotr-4.1.1/tests/unit/test_b64.c Examining data/libotr-4.1.1/tests/unit/test_privkey.c Examining data/libotr-4.1.1/tests/unit/test_instag.c Examining data/libotr-4.1.1/tests/unit/test_auth.c Examining data/libotr-4.1.1/tests/unit/test_userstate.c Examining data/libotr-4.1.1/tests/unit/test_dh.c Examining data/libotr-4.1.1/tests/unit/test_mem.c Examining data/libotr-4.1.1/tests/unit/test_tlv.c Examining data/libotr-4.1.1/tests/unit/test_sm.c Examining data/libotr-4.1.1/tests/unit/test_context.c Examining data/libotr-4.1.1/tests/unit/test_proto.c Examining data/libotr-4.1.1/tests/regression/client/client.c Examining data/libotr-4.1.1/toolkit/otr_modify.c Examining data/libotr-4.1.1/toolkit/otr_parse.c Examining data/libotr-4.1.1/toolkit/otr_readforge.c Examining data/libotr-4.1.1/toolkit/sesskeys.c Examining data/libotr-4.1.1/toolkit/ctrmode.h Examining data/libotr-4.1.1/toolkit/sha1hmac.c Examining data/libotr-4.1.1/toolkit/readotr.c Examining data/libotr-4.1.1/toolkit/sha1hmac.h Examining data/libotr-4.1.1/toolkit/aes.c Examining data/libotr-4.1.1/toolkit/otr_sesskeys.c Examining data/libotr-4.1.1/toolkit/otr_mackey.c Examining data/libotr-4.1.1/toolkit/sesskeys.h Examining data/libotr-4.1.1/toolkit/parse.h Examining data/libotr-4.1.1/toolkit/readotr.h Examining data/libotr-4.1.1/toolkit/ctrmode.c Examining data/libotr-4.1.1/toolkit/parse.c Examining data/libotr-4.1.1/toolkit/otr_remac.c Examining data/libotr-4.1.1/toolkit/aes.h Examining data/libotr-4.1.1/src/auth.c Examining data/libotr-4.1.1/src/proto.h Examining data/libotr-4.1.1/src/mem.h Examining data/libotr-4.1.1/src/userstate.c Examining data/libotr-4.1.1/src/serial.h Examining data/libotr-4.1.1/src/dh.h Examining data/libotr-4.1.1/src/instag.c Examining data/libotr-4.1.1/src/tlv.c Examining data/libotr-4.1.1/src/sm.h Examining data/libotr-4.1.1/src/instag.h Examining data/libotr-4.1.1/src/b64.h Examining data/libotr-4.1.1/src/context.c Examining data/libotr-4.1.1/src/sm.c Examining data/libotr-4.1.1/src/auth.h Examining data/libotr-4.1.1/src/context_priv.c Examining data/libotr-4.1.1/src/dh.c Examining data/libotr-4.1.1/src/userstate.h Examining data/libotr-4.1.1/src/message.h Examining data/libotr-4.1.1/src/mem.c Examining data/libotr-4.1.1/src/b64.c Examining data/libotr-4.1.1/src/tlv.h Examining data/libotr-4.1.1/src/message.c Examining data/libotr-4.1.1/src/context_priv.h Examining data/libotr-4.1.1/src/version.h Examining data/libotr-4.1.1/src/privkey-t.h Examining data/libotr-4.1.1/src/context.h Examining data/libotr-4.1.1/src/privkey.h Examining data/libotr-4.1.1/src/privkey.c Examining data/libotr-4.1.1/src/proto.c FINAL RESULTS: data/libotr-4.1.1/tests/unit/test_instag.c:176:6: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. if (readlink("/proc/self/exe", buf, len) < 0) { data/libotr-4.1.1/src/message.c:320:7: [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(context->context_priv->lastmessage, original_msg); data/libotr-4.1.1/src/message.c:349: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(taggedmsg, original_msg); data/libotr-4.1.1/src/message.c:350: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(taggedmsg + msglen, OTRL_MESSAGE_TAG_BASE); data/libotr-4.1.1/src/message.c:352:8: [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(taggedmsg + msglen + basetaglen, data/libotr-4.1.1/src/message.c:356:8: [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(taggedmsg + msglen + basetaglen + v1taglen, data/libotr-4.1.1/src/message.c:360:8: [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(taggedmsg + msglen + basetaglen + v1taglen data/libotr-4.1.1/src/message.c:411: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(*messagep, OTR_ERROR_PREFIX); data/libotr-4.1.1/src/message.c:412:4: [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(*messagep, err_msg); data/libotr-4.1.1/src/message.c:680: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(msg_to_send, resent_prefix); data/libotr-4.1.1/src/message.c:682: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(msg_to_send, edata->context->context_priv->lastmessage); data/libotr-4.1.1/src/message.c:794: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((char *)qsmpmsg, question); data/libotr-4.1.1/src/message.c:885: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(buf, OTR_ERROR_PREFIX); data/libotr-4.1.1/src/message.c:886: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(buf, err_msg); data/libotr-4.1.1/src/message.c:1384:9: [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(buf, OTR_ERROR_PREFIX); data/libotr-4.1.1/src/message.c:1385:9: [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(buf, err_msg); data/libotr-4.1.1/src/proto.c:275:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(msg, format, version_tag, ourname); data/libotr-4.1.1/src/proto.c:505:5: [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(msgdup, msg); data/libotr-4.1.1/src/proto.c:614:6: [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(context->context_priv->lastmessage, msgdup); data/libotr-4.1.1/tests/regression/client/client.c:926:8: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. ret = access(opt_instag_path, R_OK); data/libotr-4.1.1/tests/regression/client/client.c:944:8: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. ret = access(opt_key_path, R_OK); data/libotr-4.1.1/tests/regression/client/client.c:962:8: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. ret = access(opt_key_fp_path, R_OK); data/libotr-4.1.1/tests/utils/tap/tap.c:279: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(stderr, fmt, ap); data/libotr-4.1.1/tests/regression/client/client.c:1033: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/libotr-4.1.1/tests/regression/client/client.c:1102:16: [3] (buffer) getopt_long: 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 ((opt = getopt_long(argc, argv, "+i:k:f:t:m:daF", long_opts, NULL)) != -1) { data/libotr-4.1.1/tests/utils/tap/tap.c:151:6: [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. if(getenv("HARNESS_ACTIVE") != NULL) data/libotr-4.1.1/src/auth.c:150: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 ctr[16]; data/libotr-4.1.1/src/auth.c:303: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 hashbuf[32]; data/libotr-4.1.1/src/auth.c:442: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 macbuf[32]; data/libotr-4.1.1/src/auth.c:533:48: [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 gcry_error_t check_pubkey_auth(unsigned char fingerprintbufp[20], data/libotr-4.1.1/src/auth.c:542: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 macbuf[32]; data/libotr-4.1.1/src/auth.c:913: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 ctr[16], hashbuf[32]; data/libotr-4.1.1/src/auth.c:1197: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 hashbuf[20]; data/libotr-4.1.1/src/auth.c:1315: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 fingerprintbuf[20], hashbuf[20]; data/libotr-4.1.1/src/auth.h:47: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 r[16]; /* The encryption key */ data/libotr-4.1.1/src/auth.h:49: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 hashgx[32]; /* SHA256(g^x) */ data/libotr-4.1.1/src/auth.h:59: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 their_fingerprint[20]; /* The fingerprint of their data/libotr-4.1.1/src/auth.h:68: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 secure_session_id[20]; /* The secure session id */ data/libotr-4.1.1/src/b64.c:159: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 b64[4]; data/libotr-4.1.1/src/context.c:369: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 fingerprint[20], int add_if_missing, int *addedp) data/libotr-4.1.1/src/context.h:107: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 sessionid[20]; /* The sessionid and bold half */ data/libotr-4.1.1/src/context.h:156: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 fingerprint[20], int add_if_missing, int *addedp); data/libotr-4.1.1/src/dh.c:236: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 ctr[16]; data/libotr-4.1.1/src/dh.h:40: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 sendctr[16]; data/libotr-4.1.1/src/dh.h:41: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 rcvctr[16]; data/libotr-4.1.1/src/dh.h:45: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 sendmackey[20]; data/libotr-4.1.1/src/dh.h:48: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 rcvmackey[20]; data/libotr-4.1.1/src/dh.h:50: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 extrakey[OTRL_EXTRAKEY_BYTES]; data/libotr-4.1.1/src/instag.c:79: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). instf = fopen(filename, "rb"); data/libotr-4.1.1/src/instag.c:96: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 storeline[1000]; data/libotr-4.1.1/src/instag.c:192: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). instf = fopen(filename, "wb"); data/libotr-4.1.1/src/instag.c:251: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). instf = fopen(filename, "wb"); data/libotr-4.1.1/src/message.c:740: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 combined_secret[SM_DIGEST_SIZE]; data/libotr-4.1.1/src/message.c:742: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 our_fp[20]; data/libotr-4.1.1/src/message.h:109:12: [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. const char *accountname, const char *protocol, data/libotr-4.1.1/src/message.h:109:37: [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. const char *accountname, const char *protocol, data/libotr-4.1.1/src/message.h:110:12: [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. const char *username, unsigned char fingerprint[20]); data/libotr-4.1.1/src/message.h:110:37: [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. const char *username, unsigned char fingerprint[20]); data/libotr-4.1.1/src/privkey.c:36: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 human[OTRL_PRIVKEY_FPRINT_HUMAN_LEN], data/libotr-4.1.1/src/privkey.c:37:17: [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. const unsigned char hash[20]) data/libotr-4.1.1/src/privkey.c:44:6: [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(p, "%02X", hash[word*4+byte]); data/libotr-4.1.1/src/privkey.c:57:1: [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 *otrl_privkey_fingerprint(OtrlUserState us, data/libotr-4.1.1/src/privkey.c:58: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 fingerprint[OTRL_PRIVKEY_FPRINT_HUMAN_LEN], data/libotr-4.1.1/src/privkey.c:61: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 hash[20]; data/libotr-4.1.1/src/privkey.c:81:10: [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 *otrl_privkey_fingerprint_raw(OtrlUserState us, data/libotr-4.1.1/src/privkey.c:82: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 hash[20], const char *accountname, const char *protocol) data/libotr-4.1.1/src/privkey.c:188: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). privf = fopen(filename, "rb"); data/libotr-4.1.1/src/privkey.c:539: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). privf = fopen(filename, "w+b"); data/libotr-4.1.1/src/privkey.c:680: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). storef = fopen(filename, "rb"); data/libotr-4.1.1/src/privkey.c:701: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 storeline[1000]; data/libotr-4.1.1/src/privkey.c:702: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 fingerprint[20]; data/libotr-4.1.1/src/privkey.c:773: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). storef = fopen(filename, "wb"); data/libotr-4.1.1/src/privkey.h:34: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 human[OTRL_PRIVKEY_FPRINT_HUMAN_LEN], data/libotr-4.1.1/src/privkey.h:35:17: [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. const unsigned char hash[20]); data/libotr-4.1.1/src/privkey.h:40:1: [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 *otrl_privkey_fingerprint(OtrlUserState us, data/libotr-4.1.1/src/privkey.h:41: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 fingerprint[OTRL_PRIVKEY_FPRINT_HUMAN_LEN], data/libotr-4.1.1/src/privkey.h:47:10: [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 *otrl_privkey_fingerprint_raw(OtrlUserState us, data/libotr-4.1.1/src/privkey.h:48: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 hash[20], const char *accountname, const char *protocol); data/libotr-4.1.1/src/proto.c:709: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 ctr[8]; data/libotr-4.1.1/src/proto.c:713: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 givenmac[20]; data/libotr-4.1.1/src/sm.c:280: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 output[SM_DIGEST_SIZE]; data/libotr-4.1.1/tests/regression/client/client.c:305: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. const char *accountname, const char *protocol, data/libotr-4.1.1/tests/regression/client/client.c:305:34: [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. const char *accountname, const char *protocol, data/libotr-4.1.1/tests/regression/client/client.c:306: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. const char *username, unsigned char fingerprint[20]) data/libotr-4.1.1/tests/regression/client/client.c:306:34: [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. const char *username, unsigned char fingerprint[20]) data/libotr-4.1.1/tests/regression/client/client.c:1114:18: [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). timeout_max = atoi(optarg); data/libotr-4.1.1/tests/regression/client/client.c:1117:22: [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). opt_max_num_msg = atoi(optarg); data/libotr-4.1.1/tests/unit/test_context.c:29: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 fingerprint[20] = {0}; data/libotr-4.1.1/tests/unit/test_dh.c:189: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 encrypt[32] = {0}; data/libotr-4.1.1/tests/unit/test_dh.c:190: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 expected_encrypt[32] = {0}; data/libotr-4.1.1/tests/unit/test_dh.c:322: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 ctr[16] = {0}; data/libotr-4.1.1/tests/unit/test_dh.c:327: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 sessionid[8]; data/libotr-4.1.1/tests/unit/test_dh.c:330: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 encrypt[32] = {0}; data/libotr-4.1.1/tests/unit/test_dh.c:332: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 sessionid_expected[8]; data/libotr-4.1.1/tests/unit/test_dh.c:337: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 expected_encrypt[32] = {0}; data/libotr-4.1.1/tests/unit/test_dh.c:465: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 ctr[8] = {0}; data/libotr-4.1.1/tests/unit/test_dh.c:479: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 ctr1[8] = {0}, ctr2[8] = {0}; data/libotr-4.1.1/tests/unit/test_instag.c:35:8: [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 curdir[PATH_MAX]; data/libotr-4.1.1/tests/unit/test_instag.c:36:8: [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 instag_filepath[PATH_MAX]; data/libotr-4.1.1/tests/unit/test_instag.c:110: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 sone[9] = {0}, stwo[9] = {0}, sfour[9] = {0}; data/libotr-4.1.1/tests/unit/test_instag.c:139:16: [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* instf = fopen(instag_filepath, "rb"); data/libotr-4.1.1/tests/unit/test_instag.c:142: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 sone[9] = {0}, stwo[9] = {0}, sfour[9] = {0}; data/libotr-4.1.1/tests/unit/test_privkey.c:86:11: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). int fd = mkstemp(filename); data/libotr-4.1.1/tests/unit/test_privkey.c:100: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 human[OTRL_PRIVKEY_FPRINT_HUMAN_LEN]; data/libotr-4.1.1/tests/unit/test_privkey.c:101: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 hash[20]; data/libotr-4.1.1/tests/unit/test_privkey.c:114: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 fingerprint[OTRL_PRIVKEY_FPRINT_HUMAN_LEN] = {0}; data/libotr-4.1.1/tests/unit/test_privkey.c:115: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 expected_fingerprint[OTRL_PRIVKEY_FPRINT_HUMAN_LEN] = {0}; data/libotr-4.1.1/tests/unit/test_privkey.c:116: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 hash[20] = {0}; data/libotr-4.1.1/tests/unit/test_privkey.c:131: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 hash[20] = {0}; data/libotr-4.1.1/tests/unit/test_privkey.c:132: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 expected_hash[20] = {0}; data/libotr-4.1.1/tests/unit/test_sm.c:193: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 hash_secret[SM_DIGEST_SIZE]; data/libotr-4.1.1/tests/unit/test_sm.c:241: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 hash_secret[SM_DIGEST_SIZE]; data/libotr-4.1.1/toolkit/aes.c:778:17: [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 unsigned char AES_enc_test[3][16] = data/libotr-4.1.1/toolkit/aes.c:788:17: [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 unsigned char AES_dec_test[3][16] = data/libotr-4.1.1/toolkit/aes.c:802: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[16]; data/libotr-4.1.1/toolkit/aes.c:803: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 key[32]; data/libotr-4.1.1/toolkit/ctrmode.c:30:29: [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. void aes_ctr_crypt(unsigned char *out, const unsigned char *in, size_t len, data/libotr-4.1.1/toolkit/ctrmode.c:30:55: [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. void aes_ctr_crypt(unsigned char *out, const unsigned char *in, size_t len, data/libotr-4.1.1/toolkit/ctrmode.c:31: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 key[16], unsigned char ctrtop[8]) data/libotr-4.1.1/toolkit/ctrmode.c:31:34: [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 key[16], unsigned char ctrtop[8]) data/libotr-4.1.1/toolkit/ctrmode.c:33: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 ctr[16], encctr[16]; data/libotr-4.1.1/toolkit/ctrmode.h:26:29: [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. void aes_ctr_crypt(unsigned char *out, const unsigned char *in, size_t len, data/libotr-4.1.1/toolkit/ctrmode.h:26:55: [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. void aes_ctr_crypt(unsigned char *out, const unsigned char *in, size_t len, data/libotr-4.1.1/toolkit/ctrmode.h:27: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 key[16], unsigned char ctrtop[8]); data/libotr-4.1.1/toolkit/ctrmode.h:27:34: [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 key[16], unsigned char ctrtop[8]); data/libotr-4.1.1/toolkit/otr_mackey.c:40: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 mackey[20]; data/libotr-4.1.1/toolkit/otr_modify.c:49: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 macval[20]; data/libotr-4.1.1/toolkit/otr_modify.c:78:32: [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. old_text = (const unsigned char *)argv[2]; data/libotr-4.1.1/toolkit/otr_modify.c:79:32: [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. new_text = (const unsigned char *)argv[3]; data/libotr-4.1.1/toolkit/otr_parse.c:176:7: [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 title[20]; data/libotr-4.1.1/toolkit/otr_parse.c:177:7: [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(title, "\t\tKey %u", ++i); data/libotr-4.1.1/toolkit/otr_readforge.c:47: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 mackey[20]; data/libotr-4.1.1/toolkit/otr_readforge.c:48: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 macval[20]; data/libotr-4.1.1/toolkit/otr_readforge.c:117:44: [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. aes_ctr_crypt(ciphertext, (const unsigned char *)argv[2], newlen, data/libotr-4.1.1/toolkit/otr_sesskeys.c:44: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 sessionid[20], sendenc[16], rcvenc[16]; data/libotr-4.1.1/toolkit/otr_sesskeys.c:45: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 sendmac[20], rcvmac[20]; data/libotr-4.1.1/toolkit/parse.c:488:1: [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 *remac_datamsg(DataMsg datamsg, unsigned char mackey[20]) data/libotr-4.1.1/toolkit/parse.c:488:47: [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 *remac_datamsg(DataMsg datamsg, unsigned char mackey[20]) data/libotr-4.1.1/toolkit/parse.c:567:1: [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 *assemble_datamsg(unsigned char mackey[20], data/libotr-4.1.1/toolkit/parse.c:567:33: [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 *assemble_datamsg(unsigned char mackey[20], data/libotr-4.1.1/toolkit/parse.c:568: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 version, unsigned int sender_instance, data/libotr-4.1.1/toolkit/parse.c:571: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 ctr[8], unsigned char *encmsg, size_t encmsglen, data/libotr-4.1.1/toolkit/parse.h:47: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 ctr[8]; data/libotr-4.1.1/toolkit/parse.h:50: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 mac[20]; data/libotr-4.1.1/toolkit/parse.h:85: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 mac[20]; data/libotr-4.1.1/toolkit/parse.h:95: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 mac[20]; data/libotr-4.1.1/toolkit/parse.h:146:1: [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 *remac_datamsg(DataMsg datamsg, unsigned char mackey[20]); data/libotr-4.1.1/toolkit/parse.h:146:47: [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 *remac_datamsg(DataMsg datamsg, unsigned char mackey[20]); data/libotr-4.1.1/toolkit/parse.h:150:1: [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 *assemble_datamsg(unsigned char mackey[20], data/libotr-4.1.1/toolkit/parse.h:150:33: [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 *assemble_datamsg(unsigned char mackey[20], data/libotr-4.1.1/toolkit/parse.h:151: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 version, unsigned int sender_instance, data/libotr-4.1.1/toolkit/parse.h:154: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 ctr[8], unsigned char *encmsg, size_t encmsglen, data/libotr-4.1.1/toolkit/sesskeys.c:43:28: [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. void sesskeys_gen(unsigned char sessionid[20], unsigned char sendenc[16], data/libotr-4.1.1/toolkit/sesskeys.c:43:57: [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. void sesskeys_gen(unsigned char sessionid[20], unsigned char sendenc[16], data/libotr-4.1.1/toolkit/sesskeys.c:44: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 rcvenc[16], int *high_endp, gcry_mpi_t *our_yp, data/libotr-4.1.1/toolkit/sesskeys.c:50: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 hash[20]; data/libotr-4.1.1/toolkit/sesskeys.c:95:33: [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. void sesskeys_make_mac(unsigned char mackey[20], unsigned char enckey[16]) data/libotr-4.1.1/toolkit/sesskeys.c:95:59: [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. void sesskeys_make_mac(unsigned char mackey[20], unsigned char enckey[16]) data/libotr-4.1.1/toolkit/sesskeys.h:27:28: [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. void sesskeys_gen(unsigned char sessionid[20], unsigned char sendenc[16], data/libotr-4.1.1/toolkit/sesskeys.h:27:57: [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. void sesskeys_gen(unsigned char sessionid[20], unsigned char sendenc[16], data/libotr-4.1.1/toolkit/sesskeys.h:28: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 rcvenc[16], int *high_endp, gcry_mpi_t *our_yp, data/libotr-4.1.1/toolkit/sesskeys.h:32:33: [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. void sesskeys_make_mac(unsigned char mackey[20], unsigned char enckey[16]); data/libotr-4.1.1/toolkit/sesskeys.h:32:59: [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. void sesskeys_make_mac(unsigned char mackey[20], unsigned char enckey[16]); data/libotr-4.1.1/toolkit/sha1hmac.c:30:24: [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. void sha1hmac(unsigned char digest[20], unsigned char key[20], data/libotr-4.1.1/toolkit/sha1hmac.c:30:50: [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. void sha1hmac(unsigned char digest[20], unsigned char key[20], data/libotr-4.1.1/toolkit/sha1hmac.c:33: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 ipad[64], opad[64]; data/libotr-4.1.1/toolkit/sha1hmac.c:37: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 hash[20]; data/libotr-4.1.1/toolkit/sha1hmac.h:26:24: [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. void sha1hmac(unsigned char digest[20], unsigned char key[20], data/libotr-4.1.1/toolkit/sha1hmac.h:26:50: [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. void sha1hmac(unsigned char digest[20], unsigned char key[20], data/libotr-4.1.1/src/auth.c:1521:33: [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). printf("\nBob: %d\n%s\n\n", strlen(bob.lastauthmsg), bob.lastauthmsg); data/libotr-4.1.1/src/auth.c:1524: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). printf("\nAlice: %d\n%s\n\n", strlen(alice.lastauthmsg), alice.lastauthmsg); data/libotr-4.1.1/src/auth.c:1528: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). printf("\nBob: %d\n%s\n\n", strlen(bob.lastauthmsg), bob.lastauthmsg); data/libotr-4.1.1/src/auth.c:1536: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). printf("\nAlice: %d\n%s\n\n", strlen(alice.lastauthmsg), data/libotr-4.1.1/src/auth.c:1549:33: [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). printf("\nBob: %d\n%s\n\n", strlen(bob.lastauthmsg), bob.lastauthmsg); data/libotr-4.1.1/src/auth.c:1554: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). printf("\nAlice: %d\n%s\n\n", strlen(alice.lastauthmsg), data/libotr-4.1.1/src/auth.c:1563: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). printf("\nBob: %d\n%s\n\n", strlen(bob.lastauthmsg), bob.lastauthmsg); data/libotr-4.1.1/src/instag.c:155: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(prevpos) != 8) { data/libotr-4.1.1/src/message.c:84: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). msglen = strlen(message); data/libotr-4.1.1/src/message.c:272: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). debugtag + strlen(OTRL_DEBUGGING_DEBUGSTR); data/libotr-4.1.1/src/message.c:316: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). gcry_malloc_secure(strlen(original_msg) + 1); data/libotr-4.1.1/src/message.c:338: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). size_t msglen = strlen(original_msg); data/libotr-4.1.1/src/message.c:339: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). size_t basetaglen = strlen(OTRL_MESSAGE_TAG_BASE); data/libotr-4.1.1/src/message.c:341: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(OTRL_MESSAGE_TAG_V1) : 0; data/libotr-4.1.1/src/message.c:343: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(OTRL_MESSAGE_TAG_V2) : 0; data/libotr-4.1.1/src/message.c:345: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(OTRL_MESSAGE_TAG_V3) : 0; data/libotr-4.1.1/src/message.c:408: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). *messagep = malloc(strlen(OTR_ERROR_PREFIX) + data/libotr-4.1.1/src/message.c:409: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(err_msg) + 1); data/libotr-4.1.1/src/message.c:677: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). strlen(edata->context->context_priv->lastmessage) + data/libotr-4.1.1/src/message.c:678: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). strlen(resent_prefix) + 2); data/libotr-4.1.1/src/message.c:681: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(msg_to_send, " "); data/libotr-4.1.1/src/message.c:788: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). size_t qlen = strlen(question); data/libotr-4.1.1/src/message.c:882: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). char *buf = malloc(strlen(OTR_ERROR_PREFIX) + strlen(err_msg) + 1); data/libotr-4.1.1/src/message.c:882:52: [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 = malloc(strlen(OTR_ERROR_PREFIX) + strlen(err_msg) + 1); data/libotr-4.1.1/src/message.c:1381: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). buf = malloc(strlen(OTR_ERROR_PREFIX) + data/libotr-4.1.1/src/message.c:1382: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). strlen(err_msg) + 1); data/libotr-4.1.1/src/message.c:1783: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). just_err_msg += (strlen(OTR_ERROR_PREFIX)); data/libotr-4.1.1/src/message.c:1802: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). size_t restlen = strlen(endwhite); data/libotr-4.1.1/src/privkey.c:512:42: [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). err = gcry_sexp_new(&parms, parmstr, strlen(parmstr), 0); data/libotr-4.1.1/src/privkey.c:537:15: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). oldmask = umask(077); data/libotr-4.1.1/src/privkey.c:544:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(oldmask); data/libotr-4.1.1/src/privkey.c:751: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) continue; data/libotr-4.1.1/src/proto.c:270: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). msg = malloc(strlen(format) + strlen(version_tag) + strlen(ourname) - 3); data/libotr-4.1.1/src/proto.c:270: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). msg = malloc(strlen(format) + strlen(version_tag) + strlen(ourname) - 3); data/libotr-4.1.1/src/proto.c:270:57: [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 = malloc(strlen(format) + strlen(version_tag) + strlen(ourname) - 3); data/libotr-4.1.1/src/proto.c:339: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). endtag = starttag + strlen(OTRL_MESSAGE_TAG_BASE); data/libotr-4.1.1/src/proto.c:451: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). if (strlen(otrtag) < 21 ) goto invval; data/libotr-4.1.1/src/proto.c:475: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). size_t justmsglen = strlen(msg); data/libotr-4.1.1/src/proto.c:652: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). msglen = strlen(otrtag); data/libotr-4.1.1/src/proto.c:728: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). msglen = strlen(otrtag); data/libotr-4.1.1/src/proto.c:987: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 msglen = strlen(message); data/libotr-4.1.1/src/proto.c:1019:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fragdata, message, fragdatalen); data/libotr-4.1.1/tests/regression/client/client.c:149: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). msg->ciphertext_len = strlen(message); data/libotr-4.1.1/tests/regression/client/client.c:334:2: [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 string. strncpy(prefix, "[such resent]", 32); data/libotr-4.1.1/tests/regression/client/client.c:411:38: [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). !strncmp(oinfo->user, alice_name, strlen(alice_name)), data/libotr-4.1.1/tests/regression/client/client.c:416: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). !strncmp(oinfo->user, bob_name, strlen(bob_name)) && data/libotr-4.1.1/tests/regression/client/client.c:417: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). !strncmp(auth_question, question, strlen(auth_question)), data/libotr-4.1.1/tests/regression/client/client.c:424: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). (unsigned char *) auth_secret, strlen(auth_secret)); data/libotr-4.1.1/tests/regression/client/client.c:428: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). !strncmp(oinfo->user, alice_name, strlen(alice_name)), data/libotr-4.1.1/tests/regression/client/client.c:508: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). omsg->plaintext_len = strlen(msg); data/libotr-4.1.1/tests/regression/client/client.c:511: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). omsg->plaintext_len = strlen(message); data/libotr-4.1.1/tests/regression/client/client.c:523: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). omsg->ciphertext_len = strlen(omsg->ciphertext); data/libotr-4.1.1/tests/regression/client/client.c:696: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(auth_secret)); data/libotr-4.1.1/tests/regression/client/client.c:987:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sun->sun_path, pathname, sizeof(sun->sun_path)); data/libotr-4.1.1/tests/unit/test_b64.c:90: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(alphanum_decoded)); data/libotr-4.1.1/tests/unit/test_b64.c:97: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). && len == strlen(alphanum_decoded), data/libotr-4.1.1/tests/unit/test_dh.c:229: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). sizeof(expected_encrypt), test_vector, strlen(test_vector)); data/libotr-4.1.1/tests/unit/test_dh.c:231: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(test_vector)); data/libotr-4.1.1/tests/unit/test_dh.c:250: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). sizeof(expected_encrypt), test_vector, strlen(test_vector)); data/libotr-4.1.1/tests/unit/test_dh.c:252: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(test_vector)); data/libotr-4.1.1/tests/unit/test_dh.c:402: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). sizeof(expected_encrypt), test_vector, strlen(test_vector)); data/libotr-4.1.1/tests/unit/test_dh.c:404: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(test_vector)); data/libotr-4.1.1/tests/unit/test_dh.c:412: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). sizeof(expected_encrypt), test_vector, strlen(test_vector)); data/libotr-4.1.1/tests/unit/test_dh.c:414: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(test_vector)); data/libotr-4.1.1/tests/unit/test_privkey.c:167: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(data); data/libotr-4.1.1/tests/unit/test_privkey.c:225: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(data)); data/libotr-4.1.1/tests/unit/test_privkey.c:228: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). (unsigned char *) data, strlen(data)) == 0, "Signature ok"); data/libotr-4.1.1/tests/unit/test_privkey.c:231: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). (unsigned char *) data + 1, strlen(data) - 1); data/libotr-4.1.1/tests/unit/test_sm.c:200: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(secret)); data/libotr-4.1.1/tests/unit/test_sm.c:244: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(secret)); data/libotr-4.1.1/tests/unit/test_tlv.c:34: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). const unsigned short len = strlen(data); data/libotr-4.1.1/toolkit/otr_modify.c:72: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). textlen = strlen(argv[2]); data/libotr-4.1.1/toolkit/otr_modify.c:73: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). if (textlen != strlen(argv[3])) { data/libotr-4.1.1/toolkit/otr_readforge.c:111: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 newlen = strlen(argv[2]); data/libotr-4.1.1/toolkit/parse.c:78: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). if (!footer) footer = header + strlen(header); data/libotr-4.1.1/toolkit/parse.c:561:5: [1] (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 character. strcpy(outmsg + base64len - 2, "."); data/libotr-4.1.1/toolkit/parse.c:631: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(arg); data/libotr-4.1.1/toolkit/readotr.c:68: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 headerlen = strlen(header); data/libotr-4.1.1/toolkit/readotr.c:72:10: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = fgetc(stream); data/libotr-4.1.1/toolkit/readotr.c:84:10: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = fgetc(stream); ANALYSIS SUMMARY: Hits = 249 Lines analyzed = 17738 in approximately 0.73 seconds (24174 lines/second) Physical Source Lines of Code (SLOC) = 11885 Hits@level = [0] 188 [1] 80 [2] 143 [3] 3 [4] 22 [5] 1 Hits@level+ = [0+] 437 [1+] 249 [2+] 169 [3+] 26 [4+] 23 [5+] 1 Hits/KSLOC@level+ = [0+] 36.769 [1+] 20.9508 [2+] 14.2196 [3+] 2.18763 [4+] 1.93521 [5+] 0.0841397 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.