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/ser2net-3.5/devio.h Examining data/ser2net-3.5/ser2net.c Examining data/ser2net-3.5/buffer.h Examining data/ser2net-3.5/readconfig.c Examining data/ser2net-3.5/dataxfer.h Examining data/ser2net-3.5/heap.h Examining data/ser2net-3.5/dataxfer.c Examining data/ser2net-3.5/telnet.c Examining data/ser2net-3.5/utils.c Examining data/ser2net-3.5/selector.c Examining data/ser2net-3.5/readconfig.h Examining data/ser2net-3.5/selector.h Examining data/ser2net-3.5/utils.h Examining data/ser2net-3.5/led.h Examining data/ser2net-3.5/sol.c Examining data/ser2net-3.5/led.c Examining data/ser2net-3.5/buffer.c Examining data/ser2net-3.5/devcfg.c Examining data/ser2net-3.5/led_sysfs.h Examining data/ser2net-3.5/telnet.h Examining data/ser2net-3.5/controller.h Examining data/ser2net-3.5/controller.c Examining data/ser2net-3.5/led_sysfs.c Examining data/ser2net-3.5/locking.h Examining data/ser2net-3.5/ser2net.h FINAL RESULTS: data/ser2net-3.5/controller.c:270:10: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. rv = vsnprintf(buffer, sizeof(buffer), str, ap); data/ser2net-3.5/devcfg.c:173:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "%sLCK..%s", uucp_lck_dir, devname); data/ser2net-3.5/devcfg.c:786: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(str, instr); data/ser2net-3.5/readconfig.c:436:5: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(buf, sizeof(buf), str, ap); data/ser2net-3.5/ser2net.c:143:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, help_string, name); data/ser2net-3.5/sol.c:924: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, format, ap); data/ser2net-3.5/sol.c:928: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, format, ap); data/ser2net-3.5/buffer.c:126: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(buf->buf + end, data, availend); data/ser2net-3.5/buffer.c:132: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(buf->buf + end, data, len); data/ser2net-3.5/controller.c:74: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 inbuf[INBUF_SIZE + 1];/* Buffer to receive command on. */ data/ser2net-3.5/controller.c:214: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(&(cntlr->outbuf[cntlr->outbuf_count]), data, count); data/ser2net-3.5/controller.c:231: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(newbuf, data/ser2net-3.5/controller.c:234: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(newbuf + cntlr->outbuf_count, data, count); data/ser2net-3.5/controller.c:253: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(newbuf, data, count); data/ser2net-3.5/controller.c:267: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 buffer[1024]; data/ser2net-3.5/dataxfer.c:578: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. static char out[1024]; data/ser2net-3.5/dataxfer.c:628:6: [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 errbuf[128]; data/ser2net-3.5/dataxfer.c:673: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. static char buf[1024]; data/ser2net-3.5/dataxfer.c:676: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 portstr[NI_MAXSERV]; data/ser2net-3.5/dataxfer.c:703: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. static char buf[1024]; data/ser2net-3.5/dataxfer.c:1482: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 str[15]; data/ser2net-3.5/dataxfer.c:1536: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 d[10], *dp; data/ser2net-3.5/dataxfer.c:1546: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 d[10], *dp; data/ser2net-3.5/dataxfer.c:1567: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 d[10], *dp; data/ser2net-3.5/dataxfer.c:1588: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 d[10], *dp; data/ser2net-3.5/dataxfer.c:1598: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 d[10], *dp; data/ser2net-3.5/dataxfer.c:1608: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 d[10], *dp; data/ser2net-3.5/dataxfer.c:1625: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 d[10], *dp; data/ser2net-3.5/dataxfer.c:1636: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 d[10], *dp; data/ser2net-3.5/dataxfer.c:1666: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 d[10], *dp; data/ser2net-3.5/dataxfer.c:1677: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 d[30], *dp; data/ser2net-3.5/dataxfer.c:1687: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 d[10], *dp; data/ser2net-3.5/dataxfer.c:1697:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ip[100], *ipp; data/ser2net-3.5/dataxfer.c:1819:10: [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). rv = open(trfile, O_WRONLY | O_CREAT | O_APPEND, 0600); data/ser2net-3.5/dataxfer.c:1821: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 errbuf[128]; data/ser2net-3.5/dataxfer.c:2303: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(&netcon->new_remote, remaddr, remaddrlen); data/ser2net-3.5/dataxfer.c:2306: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(netcon->new_buf, port->net_to_dev.buf, buflen); data/ser2net-3.5/dataxfer.c:2335: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(netcon->raddr, &netcon->new_remote, netcon->new_raddrlen); data/ser2net-3.5/dataxfer.c:2341: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(port->net_to_dev.buf, netcon->new_buf, netcon->new_buf_len); data/ser2net-3.5/dataxfer.c:2413: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(port->netcons[i].raddr, &addr, addrlen); data/ser2net-3.5/dataxfer.c:2532: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(netcon->raddr, &remaddr, remaddrlen); data/ser2net-3.5/dataxfer.c:2589: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(netcon->raddr, &r->addr, r->addrlen); data/ser2net-3.5/dataxfer.c:2831: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_port->netcons[i].new_buf, curr->netcons[i].new_buf, data/ser2net-3.5/dataxfer.c:3138: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 data[3]; data/ser2net-3.5/dataxfer.c:3217: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(&r->addr, ai->ai_addr, ai->ai_addrlen); data/ser2net-3.5/dataxfer.c:3680: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 buffer[NI_MAXHOST], portbuff[NI_MAXSERV]; data/ser2net-3.5/dataxfer.c:3709:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(&buffer[REMOTEADDR_COLUMN_WIDTH - 3], "..."); data/ser2net-3.5/dataxfer.c:3754: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 buffer[NI_MAXHOST], portbuff[NI_MAXSERV]; data/ser2net-3.5/dataxfer.c:4143: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 data[3]; data/ser2net-3.5/dataxfer.c:4170: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 outopt[MAX_TELNET_CMD_XMIT_BUF]; data/ser2net-3.5/devcfg.c:210:6: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[64]; data/ser2net-3.5/devcfg.c:221:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(lck_file, O_RDONLY)) >= 0) { data/ser2net-3.5/devcfg.c:246:11: [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(lck_file, O_WRONLY | O_CREAT | O_EXCL, 0666); data/ser2net-3.5/devcfg.c:921:16: [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). d->devfd = open(io->devname, options); data/ser2net-3.5/led_sysfs.c:57:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(buffer, O_RDONLY)) == -1) { data/ser2net-3.5/led_sysfs.c:82: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 filename[255]; data/ser2net-3.5/led_sysfs.c:87:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(filename, O_WRONLY | O_TRUNC)) == -1) data/ser2net-3.5/led_sysfs.c:151:28: [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). drv_data->duration = atoi(value); data/ser2net-3.5/led_sysfs.c:154:25: [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). drv_data->state = atoi(value); data/ser2net-3.5/led_sysfs.c:207: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 buffer[255]; data/ser2net-3.5/readconfig.c:225: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(rv, longstr->str, longstr->length + 1); data/ser2net-3.5/readconfig.c:433: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 buf[1024]; data/ser2net-3.5/readconfig.c:1032: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). instream = fopen(filename, "r"); data/ser2net-3.5/ser2net.c:153: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). fpidfile = fopen(pid_file, "w"); data/ser2net-3.5/ser2net.c:437: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 dummy[10]; data/ser2net-3.5/sol.c:66: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 read_data[1024]; data/ser2net-3.5/sol.c:249: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(buf, d->read_data + d->read_start, left); data/ser2net-3.5/sol.c:464: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(d->read_data + d->read_end, data, space); data/ser2net-3.5/sol.c:470: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(d->read_data + d->read_end, data, count); data/ser2net-3.5/telnet.c:35: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 i[3]; data/ser2net-3.5/telnet.h:56: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 telnet_cmd[MAX_TELNET_CMD_SIZE + 1]; data/ser2net-3.5/telnet.h:69: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 out_telnet_cmdbuf[MAX_TELNET_CMD_XMIT_BUF]; data/ser2net-3.5/utils.c:359: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(s, parm, len); data/ser2net-3.5/controller.c:289:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). controller_output (cntlr, s, strlen(s)); data/ser2net-3.5/controller.c:550:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read_count = read(fd, data/ser2net-3.5/controller.c:765:31: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). write(cntlr->tcpfd, err, strlen(err)); data/ser2net-3.5/controller.c:830: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). write_ignore_fail(new_fd, err, strlen(err)); data/ser2net-3.5/dataxfer.c:561:5: [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. Risk is low because the source is a constant string. strncat(out, " |", size - pos); data/ser2net-3.5/dataxfer.c:567:5: [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. Risk is low because the source is a constant string. strncat(out + pos, "|\n", size - pos); data/ser2net-3.5/dataxfer.c:596: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). rv = write(file, out, strlen(out)); data/ser2net-3.5/dataxfer.c:607:13: [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. Risk is low because the source is a constant string. strncat(out + pos, " ", sizeof(out) - pos); data/ser2net-3.5/dataxfer.c:611:31: [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). rv = write(file, out, strlen(out)); data/ser2net-3.5/dataxfer.c:687:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len += strlen(buf + len); data/ser2net-3.5/dataxfer.c:692:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf + len, portstr, sizeof(buf) - len); data/ser2net-3.5/dataxfer.c:693:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len += strlen(buf + len); data/ser2net-3.5/dataxfer.c:852:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). count = port->io.f->read(&port->io, port->dev_to_net.buf + curend, data/ser2net-3.5/dataxfer.c:855:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). count = port->io.f->read(&port->io, port->dev_to_net.buf + curend, data/ser2net-3.5/dataxfer.c:1327:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((rv = read(fd, &c, 1)) > 0) { data/ser2net-3.5/dataxfer.c:1939:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). write_ignore_fail(netcon->fd, errstr, strlen(errstr)); data/ser2net-3.5/dataxfer.c:2159: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). write_ignore_fail(new_fd, err, strlen(err)); data/ser2net-3.5/dataxfer.c:2295: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). net_write(netcon->new_fd, err, strlen(err), 0, data/ser2net-3.5/dataxfer.c:2325: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). net_write(netcon->new_fd, err, strlen(err), 0, data/ser2net-3.5/dataxfer.c:2408: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). write_ignore_fail(new_fd, err, strlen(err)); data/ser2net-3.5/dataxfer.c:2438:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rv = read(fd, port->net_to_dev.buf, port->net_to_dev.maxsize); data/ser2net-3.5/dataxfer.c:2527: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). net_write(fd, err, strlen(err), 0, data/ser2net-3.5/dataxfer.c:2729: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). net_write(netcon->new_fd, err, strlen(err), 0, data/ser2net-3.5/dataxfer.c:3159: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). int len = strlen(prefix); data/ser2net-3.5/dataxfer.c:3708:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(buffer) > REMOTEADDR_COLUMN_WIDTH) data/ser2net-3.5/dataxfer.c:4189: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). sign_len = strlen(sig); data/ser2net-3.5/dataxfer.c:4195:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((char *) outopt + 2, sig, sign_len); data/ser2net-3.5/devcfg.c:153: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). int dev_prefix_len = strlen(dev_prefix); data/ser2net-3.5/devcfg.c:162: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). return 6 + strlen(uucp_lck_dir) + strlen(devname); data/ser2net-3.5/devcfg.c:162: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). return 6 + strlen(uucp_lck_dir) + strlen(devname); data/ser2net-3.5/devcfg.c:168: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). int i, dev_prefix_len = strlen(dev_prefix); data/ser2net-3.5/devcfg.c:174: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). for (i = strlen(uucp_lck_dir); buf[i]; i++) { data/ser2net-3.5/devcfg.c:224:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd, &buf, sizeof(buf) - 1); data/ser2net-3.5/devcfg.c:245:13: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mask = umask(022); data/ser2net-3.5/devcfg.c:247:6: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(mask); data/ser2net-3.5/devcfg.c:253: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). rv = write_full(fd, buf.str, strlen(buf.str)); data/ser2net-3.5/devcfg.c:668:56: [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). devcfg_serparm_to_str(struct devio *io, char *str, int strlen) data/ser2net-3.5/devcfg.c:703:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(str, strlen, "%s %c%c%c", sstr, pchar, dchar, schar); data/ser2net-3.5/devcfg.c:781: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). str = malloc(strlen(instr) + 1); data/ser2net-3.5/devcfg.c:988:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(d->devfd, buf, size); data/ser2net-3.5/devio.h:50:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int (*read)(struct devio *io, void *buf, size_t size); data/ser2net-3.5/devio.h:70:61: [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). void (*serparm_to_str)(struct devio *io, char *str, int strlen); data/ser2net-3.5/led_sysfs.c:62:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((c = read(fd, buffer, BUFSIZE)) <= 0) { data/ser2net-3.5/led_sysfs.c:90: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). if (write(fd, buf, strlen(buf)) != strlen(buf)) { data/ser2net-3.5/led_sysfs.c:90: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). if (write(fd, buf, strlen(buf)) != strlen(buf)) { data/ser2net-3.5/readconfig.c:88: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). unsigned int cleft = strlen(string); data/ser2net-3.5/readconfig.c:181: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). longstr->length = strlen(line); data/ser2net-3.5/readconfig.c:420: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). int len = strlen(test); data/ser2net-3.5/readconfig.c:459: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(enums->str) == len && strncmp(enums->str, str, len) == 0) data/ser2net-3.5/readconfig.c:881: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). if ((str == NULL) || (strlen(str) == 0)) { data/ser2net-3.5/readconfig.c:912:31: [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 ((str == NULL) || (strlen(str) == 0)) { data/ser2net-3.5/readconfig.c:950: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). if ((str == NULL) || (strlen(str) == 0)) { data/ser2net-3.5/readconfig.c:1040:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(inbuf); data/ser2net-3.5/readconfig.c:1066:28: [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). handle_config_line(inbuf, strlen(inbuf)); data/ser2net-3.5/ser2net.c:439:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). dummyrv = read(fd, dummy, sizeof(dummy)); data/ser2net-3.5/ser2net.c:523: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). if ((argv[i][0] != '-') || (strlen(argv[i]) != 2)) { data/ser2net-3.5/ser2net.c:669: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). handle_config_line(config_lines[i], strlen(config_lines[i])); data/ser2net-3.5/sol.c:175:56: [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). solcfg_serparm_to_str(struct devio *io, char *str, int strlen) data/ser2net-3.5/sol.c:179:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(str, strlen, "%s", baud_string(d->speed)); ANALYSIS SUMMARY: Hits = 132 Lines analyzed = 13771 in approximately 0.36 seconds (38732 lines/second) Physical Source Lines of Code (SLOC) = 10437 Hits@level = [0] 185 [1] 59 [2] 66 [3] 0 [4] 7 [5] 0 Hits@level+ = [0+] 317 [1+] 132 [2+] 73 [3+] 7 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 30.3727 [1+] 12.6473 [2+] 6.99435 [3+] 0.670691 [4+] 0.670691 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.