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/mactelnet-0.4.4/src/macping.c Examining data/mactelnet-0.4.4/src/console.h Examining data/mactelnet-0.4.4/src/mactelnet.h Examining data/mactelnet-0.4.4/src/md5.h Examining data/mactelnet-0.4.4/src/users.h Examining data/mactelnet-0.4.4/src/users.c Examining data/mactelnet-0.4.4/src/md5.c Examining data/mactelnet-0.4.4/src/protocol.h Examining data/mactelnet-0.4.4/src/interfaces.c Examining data/mactelnet-0.4.4/src/mactelnet.c Examining data/mactelnet-0.4.4/src/protocol.c Examining data/mactelnet-0.4.4/src/mndp.h Examining data/mactelnet-0.4.4/src/mndp.c Examining data/mactelnet-0.4.4/src/config.h Examining data/mactelnet-0.4.4/src/mactelnetd.c Examining data/mactelnet-0.4.4/src/autologin.c Examining data/mactelnet-0.4.4/src/gettext.h Examining data/mactelnet-0.4.4/src/autologin.h Examining data/mactelnet-0.4.4/src/extra.h Examining data/mactelnet-0.4.4/src/utlist.h Examining data/mactelnet-0.4.4/src/interfaces.h Examining data/mactelnet-0.4.4/src/console.c FINAL RESULTS: data/mactelnet-0.4.4/src/mactelnetd.c:501:3: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. chown(slavename, user->pw_uid, user->pw_gid); data/mactelnet-0.4.4/src/interfaces.c:428: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(req_if.ifr_name, interface->name); data/mactelnet-0.4.4/src/macping.c:74:2: [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(stderr, PROGRAM_NAME " " PACKAGE_VERSION "\n"); data/mactelnet-0.4.4/src/mactelnet.c:116:2: [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(stderr, PROGRAM_NAME " " PACKAGE_VERSION "\n"); data/mactelnet-0.4.4/src/mactelnet.c:664:9: [4] (misc) getpass: This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do exactly what you want. If you continue to use it, or write your own, be sure to zero the password as soon as possible to avoid leaving the cleartext password visible in the process' address space. tmp = getpass(quiet_mode ? "" : _("Password: ")); data/mactelnet-0.4.4/src/mactelnetd.c:576:4: [4] (shell) execl: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. execl(user->pw_shell, user->pw_shell, "-", (char *) 0); data/mactelnet-0.4.4/src/mactelnetd.c:809:2: [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(stderr, PROGRAM_NAME " " PACKAGE_VERSION "\n"); data/mactelnet-0.4.4/src/autologin.c:53:34: [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 (*path == '~' && (homepath = getenv("HOME"))) { data/mactelnet-0.4.4/src/macping.c:126:7: [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. c = getopt(argc, argv, "fs:c:hv?"); data/mactelnet-0.4.4/src/macping.c:228: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/mactelnet-0.4.4/src/mactelnet.c:213:19: [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. char *terminal = getenv("TERM"); data/mactelnet-0.4.4/src/mactelnet.c:478:7: [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. c = getopt(argc, argv, "lnqt:u:p:U:vh?BAa:"); data/mactelnet-0.4.4/src/mactelnet.c:613: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/mactelnet-0.4.4/src/mactelnetd.c:964:14: [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 ((c = getopt(argc, argv, "fnvh?")) != -1) { data/mactelnet-0.4.4/src/mactelnetd.c:1010: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/mactelnet-0.4.4/src/autologin.c:54: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. static char newpath[256]; data/mactelnet-0.4.4/src/autologin.c:69: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 key[AUTOLOGIN_MAXSTR]; data/mactelnet-0.4.4/src/autologin.c:71: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 value[AUTOLOGIN_MAXSTR]; data/mactelnet-0.4.4/src/autologin.c:80: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). fp = fopen(file_to_read, "r"); data/mactelnet-0.4.4/src/autologin.h:23: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 identifier[AUTOLOGIN_MAXSTR]; data/mactelnet-0.4.4/src/autologin.h:24: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 username[AUTOLOGIN_MAXSTR]; data/mactelnet-0.4.4/src/autologin.h:25: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 password[AUTOLOGIN_MAXSTR]; data/mactelnet-0.4.4/src/console.c:37: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(&new, &orig_term, sizeof(struct termios) ); data/mactelnet-0.4.4/src/gettext.h:210: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 msg_ctxt_id[msgctxt_len + msgid_len]; data/mactelnet-0.4.4/src/gettext.h:212: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[1024]; data/mactelnet-0.4.4/src/gettext.h:220:7: [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 (msg_ctxt_id, msgctxt, msgctxt_len - 1); data/mactelnet-0.4.4/src/gettext.h:222:7: [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 (msg_ctxt_id + msgctxt_len, msgid, msgid_len); data/mactelnet-0.4.4/src/gettext.h:256: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 msg_ctxt_id[msgctxt_len + msgid_len]; data/mactelnet-0.4.4/src/gettext.h:258: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[1024]; data/mactelnet-0.4.4/src/gettext.h:266:7: [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 (msg_ctxt_id, msgctxt, msgctxt_len - 1); data/mactelnet-0.4.4/src/gettext.h:268:7: [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 (msg_ctxt_id + msgctxt_len, msgid, msgid_len); data/mactelnet-0.4.4/src/interfaces.c:104: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(interface->mac_addr, ifr.ifr_hwaddr.sa_data, ETH_ALEN); data/mactelnet-0.4.4/src/interfaces.c:152: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(interface->ipv4_addr, &dl_addr->sin_addr, IPV4_ALEN); data/mactelnet-0.4.4/src/interfaces.c:166: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(interface->mac_addr, LLADDR(sdl), ETH_ALEN); data/mactelnet-0.4.4/src/interfaces.c:281:7: [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/bpf0", O_RDWR); data/mactelnet-0.4.4/src/interfaces.c:299:18: [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 stackbuf[ETH_FRAME_LEN]; data/mactelnet-0.4.4/src/interfaces.c:329: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(eh->ether_shost, sourcemac, ETH_ALEN); data/mactelnet-0.4.4/src/interfaces.c:330: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(eh->ether_dhost, destmac, ETH_ALEN); data/mactelnet-0.4.4/src/interfaces.c:333: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(eh->h_source, sourcemac, ETH_ALEN); data/mactelnet-0.4.4/src/interfaces.c:334: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(eh->h_dest, destmac, ETH_ALEN); data/mactelnet-0.4.4/src/interfaces.c:347: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(socket_address.sll_addr, eh->h_source, ETH_ALEN); data/mactelnet-0.4.4/src/interfaces.c:400: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(rest, data, datalen); data/mactelnet-0.4.4/src/interfaces.h:25: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 name[256]; data/mactelnet-0.4.4/src/interfaces.h:26: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 ipv4_addr[IPV4_ALEN]; data/mactelnet-0.4.4/src/interfaces.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 mac_addr[ETH_ALEN]; data/mactelnet-0.4.4/src/macping.c:62: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 dstmac[ETH_ALEN]; data/mactelnet-0.4.4/src/macping.c:138:17: [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). ping_size = atoi(optarg) - 18; data/mactelnet-0.4.4/src/macping.c:147:20: [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). send_packets = atoi(optarg); data/mactelnet-0.4.4/src/macping.c:248: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. unsigned char pingdata[MT_PACKET_LEN]; data/mactelnet-0.4.4/src/macping.c:252: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(pingdata, ×tamp, sizeof(timestamp)); data/mactelnet-0.4.4/src/macping.c:294:13: [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 buff[MT_PACKET_LEN]; data/mactelnet-0.4.4/src/macping.c:337: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(&lasttimestamp, &pongtimestamp, sizeof(pongtimestamp)); data/mactelnet-0.4.4/src/mactelnet.c:80: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 srcmac[ETH_ALEN]; data/mactelnet-0.4.4/src/mactelnet.c:81: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 dstmac[ETH_ALEN]; data/mactelnet-0.4.4/src/mactelnet.c:96: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 autologin_path[255]; data/mactelnet-0.4.4/src/mactelnet.c:100: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 pass_salt[16]; data/mactelnet-0.4.4/src/mactelnet.c:101: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 username[MT_MNDP_MAX_STRING_SIZE]; data/mactelnet-0.4.4/src/mactelnet.c:102: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 password[MT_MNDP_MAX_STRING_SIZE]; data/mactelnet-0.4.4/src/mactelnet.c:103: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 nonpriv_username[MT_MNDP_MAX_STRING_SIZE]; data/mactelnet-0.4.4/src/mactelnet.c:183: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 buff[MT_PACKET_LEN]; data/mactelnet-0.4.4/src/mactelnet.c:214: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 md5data[100]; data/mactelnet-0.4.4/src/mactelnet.c:215: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 md5sum[17]; data/mactelnet-0.4.4/src/mactelnet.c:229: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(md5data + 1, password, act_pass_len); data/mactelnet-0.4.4/src/mactelnet.c:231: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(md5data + 1 + act_pass_len, pass_salt, 16); data/mactelnet-0.4.4/src/mactelnet.c:323: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(pass_salt, cpkt.data, 16); data/mactelnet-0.4.4/src/mactelnet.c:385: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 emptymac[ETH_ALEN]; data/mactelnet-0.4.4/src/mactelnet.c:409: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((void *)&myip.sin_addr, interface->ipv4_addr, IPV4_ALEN); data/mactelnet-0.4.4/src/mactelnet.c:433: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(srcmac, interface->mac_addr, ETH_ALEN); data/mactelnet-0.4.4/src/mactelnet.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 buff[MT_PACKET_LEN]; data/mactelnet-0.4.4/src/mactelnet.c:515:23: [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). connect_timeout = atoi(optarg); data/mactelnet-0.4.4/src/mactelnet.c:683: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(&sourceip, &(si_me.sin_addr), IPV4_ALEN); data/mactelnet-0.4.4/src/mactelnet.c:750: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 keydata[512]; data/mactelnet-0.4.4/src/mactelnetd.c:130: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 interface_name[256]; data/mactelnet-0.4.4/src/mactelnetd.c:146: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 username[MT_MNDP_MAX_STRING_SIZE]; data/mactelnet-0.4.4/src/mactelnetd.c:147: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 trypassword[17]; data/mactelnet-0.4.4/src/mactelnetd.c:148: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 srcip[IPV4_ALEN]; data/mactelnet-0.4.4/src/mactelnetd.c:149: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 srcmac[ETH_ALEN]; data/mactelnet-0.4.4/src/mactelnetd.c: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 dstmac[ETH_ALEN]; data/mactelnet-0.4.4/src/mactelnetd.c:152: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 pass_salt[16]; data/mactelnet-0.4.4/src/mactelnetd.c:155: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 terminal_type[30]; data/mactelnet-0.4.4/src/mactelnetd.c:239: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(&(si_me.sin_addr.s_addr), interface->ipv4_addr, IPV4_ALEN); data/mactelnet-0.4.4/src/mactelnetd.c:267: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 dstmac[ETH_ALEN]; data/mactelnet-0.4.4/src/mactelnetd.c:288:12: [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 ((fp = fopen("/etc/motd", "r"))) { data/mactelnet-0.4.4/src/mactelnetd.c:300:12: [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 ((fp = fopen(_PATH_NOLOGIN, "r"))) { data/mactelnet-0.4.4/src/mactelnetd.c:407: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 md5sum[17]; data/mactelnet-0.4.4/src/mactelnetd.c:408: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 md5data[100]; data/mactelnet-0.4.4/src/mactelnetd.c:432: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(md5data + 1, user->password, act_pass_len); data/mactelnet-0.4.4/src/mactelnetd.c:433: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(md5data + 1 + act_pass_len, curconn->pass_salt, 16); data/mactelnet-0.4.4/src/mactelnetd.c:503:22: [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). curconn->slavefd = open(slavename, O_RDWR); data/mactelnet-0.4.4/src/mactelnetd.c:621: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(curconn->username, cpkt.data, act_size = (cpkt.length > MT_MNDP_MAX_STRING_SIZE - 1 ? MT_MNDP_MAX_STRING_SIZE - 1 : cpkt.length)); data/mactelnet-0.4.4/src/mactelnetd.c:628: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(&width, cpkt.data, 2); data/mactelnet-0.4.4/src/mactelnetd.c:635: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(&height, cpkt.data, 2); data/mactelnet-0.4.4/src/mactelnetd.c:641: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(curconn->terminal_type, cpkt.data, act_size = (cpkt.length > 30 - 1 ? 30 - 1 : cpkt.length)); data/mactelnet-0.4.4/src/mactelnetd.c:649: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(curconn->trypassword, cpkt.data, 17); data/mactelnet-0.4.4/src/mactelnetd.c:725: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(curconn->srcmac, pkthdr.srcaddr, ETH_ALEN); data/mactelnet-0.4.4/src/mactelnetd.c:726: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(curconn->srcip, &(address->sin_addr), IPV4_ALEN); data/mactelnet-0.4.4/src/mactelnetd.c:728: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(curconn->dstmac, pkthdr.dstaddr, ETH_ALEN); data/mactelnet-0.4.4/src/mactelnetd.c:1037: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(&(si_me.sin_addr), &sourceip, IPV4_ALEN); data/mactelnet-0.4.4/src/mactelnetd.c:1059: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(&(si_me_mndp.sin_addr), &sourceip, IPV4_ALEN); data/mactelnet-0.4.4/src/mactelnetd.c:1131: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 buff[MT_PACKET_LEN]; data/mactelnet-0.4.4/src/mactelnetd.c:1140: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 buff[MT_PACKET_LEN]; data/mactelnet-0.4.4/src/mactelnetd.c:1155:15: [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 keydata[1024]; data/mactelnet-0.4.4/src/md5.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(xbuf, data, 64); data/mactelnet-0.4.4/src/md5.c:343: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(pms->buf + offset, p, copy); data/mactelnet-0.4.4/src/md5.c:357: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(pms->buf, p, left); data/mactelnet-0.4.4/src/mndp.c:61: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 buff[MT_PACKET_LEN]; data/mactelnet-0.4.4/src/mndp.c:124: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 ipstr[INET_ADDRSTRLEN]; data/mactelnet-0.4.4/src/protocol.c:63: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(data + 2, srcmac, ETH_ALEN); data/mactelnet-0.4.4/src/protocol.c:66: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(data + 8, dstmac, ETH_ALEN); data/mactelnet-0.4.4/src/protocol.c:70: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(data + (mt_direction_fromserver ? 16 : 14), &sessionkey, sizeof(sessionkey)); data/mactelnet-0.4.4/src/protocol.c:73: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(data + (mt_direction_fromserver ? 14 : 16), &mt_mactelnet_clienttype, sizeof(mt_mactelnet_clienttype)); data/mactelnet-0.4.4/src/protocol.c:77: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(data + 18, &counter, sizeof(counter)); data/mactelnet-0.4.4/src/protocol.c:99: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(data, cpdata, data_len); data/mactelnet-0.4.4/src/protocol.c:105: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(data, mt_mactelnet_cpmagic, sizeof(mt_mactelnet_cpmagic)); data/mactelnet-0.4.4/src/protocol.c:115: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(data + 5, &templen, sizeof(templen)); data/mactelnet-0.4.4/src/protocol.c:118: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(data + 5, &data_len, sizeof(data_len)); data/mactelnet-0.4.4/src/protocol.c:123: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(data + MT_CPHEADER_LEN, cpdata, data_len); data/mactelnet-0.4.4/src/protocol.c:160: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(packet->data + packet->size, data, length); data/mactelnet-0.4.4/src/protocol.c:174: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(pkthdr->srcaddr, data + 2, ETH_ALEN); data/mactelnet-0.4.4/src/protocol.c:177: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(pkthdr->dstaddr, data + 8, ETH_ALEN); data/mactelnet-0.4.4/src/protocol.c:180: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(&(pkthdr->seskey), data + (mt_direction_fromserver ? 14 : 16), sizeof(pkthdr->seskey)); data/mactelnet-0.4.4/src/protocol.c:184: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(&(pkthdr->clienttype), data + (mt_direction_fromserver ? 16 : 14), 2); data/mactelnet-0.4.4/src/protocol.c:187: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(&(pkthdr->counter), data + 18, sizeof(pkthdr->counter)); data/mactelnet-0.4.4/src/protocol.c:229: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(&(cpkthdr->length), data + 5, sizeof(cpkthdr->length)); data/mactelnet-0.4.4/src/protocol.c:284: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(data, &type, sizeof(type)); data/mactelnet-0.4.4/src/protocol.c:287: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(data + 2, &len, sizeof(len)); data/mactelnet-0.4.4/src/protocol.c:289: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(data + 4, attrdata, data_len); data/mactelnet-0.4.4/src/protocol.c:312: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(&packetp->header, mndp_hdr, sizeof(struct mt_mndp_hdr)); data/mactelnet-0.4.4/src/protocol.c:319: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(&type, p, 2); data/mactelnet-0.4.4/src/protocol.c:320: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(&len, p + 2, 2); data/mactelnet-0.4.4/src/protocol.c:338:6: [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(packetp->address, p, ETH_ALEN); data/mactelnet-0.4.4/src/protocol.c:347: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(packetp->identity, p, len); data/mactelnet-0.4.4/src/protocol.c:356: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(packetp->platform, p, len); data/mactelnet-0.4.4/src/protocol.c:365: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(packetp->version, p, len); data/mactelnet-0.4.4/src/protocol.c:371:6: [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(&packetp->uptime, p, 4); data/mactelnet-0.4.4/src/protocol.c:382: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(packetp->hardware, p, len); data/mactelnet-0.4.4/src/protocol.c:391: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(packetp->softid, p, len); data/mactelnet-0.4.4/src/protocol.c:400: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(packetp->ifname, p, len); data/mactelnet-0.4.4/src/protocol.c:420: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 buff[MT_PACKET_LEN]; data/mactelnet-0.4.4/src/protocol.c:492: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(mac, packet->address, ETH_ALEN); data/mactelnet-0.4.4/src/protocol.c:558: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(dstmac, dstmac_buf, sizeof(struct ether_addr)); data/mactelnet-0.4.4/src/protocol.h:92: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 clienttype[2]; data/mactelnet-0.4.4/src/protocol.h:93: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 srcaddr[6]; data/mactelnet-0.4.4/src/protocol.h:94: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 dstaddr[6]; data/mactelnet-0.4.4/src/protocol.h:109: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 address[ETH_ALEN]; data/mactelnet-0.4.4/src/protocol.h: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 identity[MT_MNDP_MAX_STRING_SIZE]; data/mactelnet-0.4.4/src/protocol.h:111: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 version[MT_MNDP_MAX_STRING_SIZE]; data/mactelnet-0.4.4/src/protocol.h:112: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 platform[MT_MNDP_MAX_STRING_SIZE]; data/mactelnet-0.4.4/src/protocol.h:113: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 hardware[MT_MNDP_MAX_STRING_SIZE]; data/mactelnet-0.4.4/src/protocol.h: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 softid[MT_MNDP_MAX_STRING_SIZE]; data/mactelnet-0.4.4/src/protocol.h: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 ifname[MT_MNDP_MAX_STRING_SIZE]; data/mactelnet-0.4.4/src/protocol.h:121: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 data[MT_PACKET_LEN]; data/mactelnet-0.4.4/src/protocol.h:148:23: [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 const unsigned char mt_mactelnet_cpmagic[4] = { 0x56, 0x34, 0x12, 0xff }; data/mactelnet-0.4.4/src/protocol.h:149:23: [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 const unsigned char mt_mactelnet_clienttype[2] = { 0x00, 0x15 }; data/mactelnet-0.4.4/src/users.c:34: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). FILE *file = fopen(USERSFILE, "r"); data/mactelnet-0.4.4/src/users.c:35: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 line [BUFSIZ]; data/mactelnet-0.4.4/src/users.c:66: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(cred->username, user, size = (strlen(user) < MT_CRED_LEN ? strlen(user) : MT_CRED_LEN - 1)); data/mactelnet-0.4.4/src/users.c:68: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(cred->password, password, size = (strlen(password) < MT_CRED_LEN ? strlen(password) : MT_CRED_LEN - 1)); data/mactelnet-0.4.4/src/users.h:26: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 username[MT_CRED_LEN]; data/mactelnet-0.4.4/src/users.h:27: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 password[MT_CRED_LEN]; data/mactelnet-0.4.4/src/autologin.c:38: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(identifier) == 0) return NULL; data/mactelnet-0.4.4/src/autologin.c:56:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(newpath, homepath, sizeof(newpath) - 1); data/mactelnet-0.4.4/src/autologin.c:58:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(newpath, path+1, sizeof(newpath) - strlen(newpath) - 1); data/mactelnet-0.4.4/src/autologin.c:58:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncat(newpath, path+1, sizeof(newpath) - strlen(newpath) - 1); data/mactelnet-0.4.4/src/autologin.c:89:14: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(fp)) && !feof(fp)) { data/mactelnet-0.4.4/src/autologin.c:91:16: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(fp)) != '\n' && !feof(fp)); data/mactelnet-0.4.4/src/autologin.c:142:18: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(fp)) != '\n' && c != ']' && !feof(fp)); data/mactelnet-0.4.4/src/autologin.c:170:18: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(fp)) != '\n' && c != '=' && !feof(fp)); data/mactelnet-0.4.4/src/autologin.c:183:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(login_profiles[i].username, value, AUTOLOGIN_MAXSTR); data/mactelnet-0.4.4/src/autologin.c:186:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(login_profiles[i].password, value, AUTOLOGIN_MAXSTR); data/mactelnet-0.4.4/src/autologin.c:201:18: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = fgetc(fp)) != '\n' && !feof(fp)); data/mactelnet-0.4.4/src/gettext.h:206: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). size_t msgctxt_len = strlen (msgctxt) + 1; data/mactelnet-0.4.4/src/gettext.h:207: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_t msgid_len = strlen (msgid) + 1; data/mactelnet-0.4.4/src/gettext.h:252: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). size_t msgctxt_len = strlen (msgctxt) + 1; data/mactelnet-0.4.4/src/gettext.h:253: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_t msgid_len = strlen (msgid) + 1; data/mactelnet-0.4.4/src/interfaces.c:77:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(interface->name, name, 254); data/mactelnet-0.4.4/src/interfaces.c:101:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, interface->name, 16); data/mactelnet-0.4.4/src/interfaces.c:120:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ifr.ifr_name, device_name, 16); data/mactelnet-0.4.4/src/mactelnet.c:242:66: [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). plen += add_control_packet(&data, MT_CPTYPE_USERNAME, username, strlen(username)); data/mactelnet-0.4.4/src/mactelnet.c:243:67: [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). plen += add_control_packet(&data, MT_CPTYPE_TERM_TYPE, terminal, strlen(terminal)); data/mactelnet-0.4.4/src/mactelnet.c:471:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(autologin_path, AUTOLOGIN_PATH, sizeof(autologin_path)); data/mactelnet-0.4.4/src/mactelnet.c:492:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(username, optarg, sizeof(username) - 1); data/mactelnet-0.4.4/src/mactelnet.c:502:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(password, optarg, sizeof(password) - 1); data/mactelnet-0.4.4/src/mactelnet.c:509:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(nonpriv_username, optarg, sizeof(nonpriv_username) - 1); data/mactelnet-0.4.4/src/mactelnet.c:541:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(autologin_path, optarg, sizeof(autologin_path) - 1); data/mactelnet-0.4.4/src/mactelnet.c:598:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(username, login_profile->username, sizeof(username) - 1); data/mactelnet-0.4.4/src/mactelnet.c:606:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(password, login_profile->password, sizeof(password) - 1); data/mactelnet-0.4.4/src/mactelnet.c:659:3: [1] (buffer) scanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. scanf("%127s", username); data/mactelnet-0.4.4/src/mactelnet.c:668:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(password, tmp, sizeof(password) - 1); data/mactelnet-0.4.4/src/mactelnet.c:671: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). memset(tmp, 0, strlen(tmp)); data/mactelnet-0.4.4/src/mactelnet.c:753:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datalen = read(STDIN_FILENO, &keydata, sizeof(keydata)); data/mactelnet-0.4.4/src/mactelnetd.c:289:15: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = getc(fp)) != EOF) { data/mactelnet-0.4.4/src/mactelnetd.c:301:15: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((c = getc(fp)) != EOF) { data/mactelnet-0.4.4/src/mactelnetd.c:327:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(utent.ut_user, conn->username, sizeof(utent.ut_user)); data/mactelnet-0.4.4/src/mactelnetd.c:328:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(utent.ut_line, line, sizeof(utent.ut_line)); data/mactelnet-0.4.4/src/mactelnetd.c:329:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(utent.ut_id, utent.ut_line + 3, sizeof(utent.ut_id)); data/mactelnet-0.4.4/src/mactelnetd.c:330:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(utent.ut_host, data/mactelnet-0.4.4/src/mactelnetd.c:396:59: [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). add_control_packet(&pdata, MT_CPTYPE_PLAINDATA, message, strlen(message)); data/mactelnet-0.4.4/src/mactelnetd.c:422: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). mlock(user->password, strlen(user->password)); data/mactelnet-0.4.4/src/mactelnetd.c:427: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). act_pass_len = strlen(user->password); data/mactelnet-0.4.4/src/mactelnetd.c:723:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(curconn->interface_name, interface->name, 254); data/mactelnet-0.4.4/src/mactelnetd.c:855:70: [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). mndp_add_attribute(&pdata, MT_MNDPTYPE_IDENTITY, s_uname.nodename, strlen(s_uname.nodename)); data/mactelnet-0.4.4/src/mactelnetd.c:856:68: [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). mndp_add_attribute(&pdata, MT_MNDPTYPE_VERSION, s_uname.release, strlen(s_uname.release)); data/mactelnet-0.4.4/src/mactelnetd.c:857:67: [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). mndp_add_attribute(&pdata, MT_MNDPTYPE_PLATFORM, PLATFORM_NAME, strlen(PLATFORM_NAME)); data/mactelnet-0.4.4/src/mactelnetd.c:858:69: [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). mndp_add_attribute(&pdata, MT_MNDPTYPE_HARDWARE, s_uname.machine, strlen(s_uname.machine)); data/mactelnet-0.4.4/src/mactelnetd.c:860:71: [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). mndp_add_attribute(&pdata, MT_MNDPTYPE_SOFTID, MT_SOFTID_MACTELNET, strlen(MT_SOFTID_MACTELNET)); data/mactelnet-0.4.4/src/mactelnetd.c:861:67: [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). mndp_add_attribute(&pdata, MT_MNDPTYPE_IFNAME, interface->name, strlen(interface->name)); data/mactelnet-0.4.4/src/mactelnetd.c:880:64: [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). add_control_packet(&pdata, MT_CPTYPE_PLAINDATA, _(message), strlen(_(message))); data/mactelnet-0.4.4/src/mactelnetd.c:1159:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). datalen = read(p->ptsfd, &keydata, sizeof(keydata)); data/mactelnet-0.4.4/src/users.c:66:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy(cred->username, user, size = (strlen(user) < MT_CRED_LEN ? strlen(user) : MT_CRED_LEN - 1)); data/mactelnet-0.4.4/src/users.c:66:69: [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(cred->username, user, size = (strlen(user) < MT_CRED_LEN ? strlen(user) : MT_CRED_LEN - 1)); data/mactelnet-0.4.4/src/users.c:68: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). memcpy(cred->password, password, size = (strlen(password) < MT_CRED_LEN ? strlen(password) : MT_CRED_LEN - 1)); data/mactelnet-0.4.4/src/users.c:68:77: [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(cred->password, password, size = (strlen(password) < MT_CRED_LEN ? strlen(password) : MT_CRED_LEN - 1)); ANALYSIS SUMMARY: Hits = 213 Lines analyzed = 6102 in approximately 0.20 seconds (29962 lines/second) Physical Source Lines of Code (SLOC) = 4203 Hits@level = [0] 115 [1] 53 [2] 145 [3] 8 [4] 6 [5] 1 Hits@level+ = [0+] 328 [1+] 213 [2+] 160 [3+] 15 [4+] 7 [5+] 1 Hits/KSLOC@level+ = [0+] 78.0395 [1+] 50.6781 [2+] 38.068 [3+] 3.56888 [4+] 1.66548 [5+] 0.237925 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.