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/picocom-3.1/custbaud_bsd.c
Examining data/picocom-3.1/custbaud_bsd.h
Examining data/picocom-3.1/fdio.c
Examining data/picocom-3.1/fdio.h
Examining data/picocom-3.1/linenoise-1.0/example.c
Examining data/picocom-3.1/linenoise-1.0/linenoise.c
Examining data/picocom-3.1/linenoise-1.0/linenoise.h
Examining data/picocom-3.1/picocom.c
Examining data/picocom-3.1/split.c
Examining data/picocom-3.1/split.h
Examining data/picocom-3.1/term.c
Examining data/picocom-3.1/term.h
Examining data/picocom-3.1/termbits2.h
Examining data/picocom-3.1/termios2.c
Examining data/picocom-3.1/termios2.h
Examining data/picocom-3.1/custbaud.h

FINAL RESULTS:

data/picocom-3.1/fdio.c:61:11:  [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.
    len = vsnprintf(buf, sizeof(buf), format, ap);
data/picocom-3.1/linenoise-1.0/linenoise.c:185:13:  [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(lndebug_fp, \
data/picocom-3.1/linenoise-1.0/linenoise.c:190:9:  [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(lndebug_fp, ", " __VA_ARGS__); \
data/picocom-3.1/picocom.c:553:9:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(history_file_path, HISTFILE);
data/picocom-3.1/picocom.c:1171:9:  [4] (shell) execvp:
  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.
        execvp(argv[0], argv);
data/picocom-3.1/linenoise-1.0/linenoise.c:207:18:  [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 *term = getenv("TERM");
data/picocom-3.1/picocom.c:545:22:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    home_directory = getenv("HOME");
data/picocom-3.1/picocom.c:1725:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv, "hirulcqXnv:s:r:e:f:b:y:d:p:g:t:x:",
data/picocom-3.1/fdio.c:58: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[256];
data/picocom-3.1/fdio.c:101: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 b[4];
data/picocom-3.1/linenoise-1.0/example.c:56: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).
            int len = atoi(line+11);
data/picocom-3.1/linenoise-1.0/linenoise.c:184:26:  [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).
            lndebug_fp = fopen("/tmp/lndebug.txt","a"); \
data/picocom-3.1/linenoise-1.0/linenoise.c:262: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[32];
data/picocom-3.1/linenoise-1.0/linenoise.c:303: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.
            char seq[32];
data/picocom-3.1/linenoise-1.0/linenoise.c:422: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(copy,str,len+1);
data/picocom-3.1/linenoise-1.0/linenoise.c:452: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(new+ab->len,s,len);
data/picocom-3.1/linenoise-1.0/linenoise.c:466: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 seq[64];
data/picocom-3.1/linenoise-1.0/linenoise.c:505: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 seq[64];
data/picocom-3.1/linenoise-1.0/linenoise.c:756:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char seq[3];
data/picocom-3.1/linenoise-1.0/linenoise.c:911: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 quit[4];
data/picocom-3.1/linenoise-1.0/linenoise.c:968: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[LINENOISE_MAX_LINE];
data/picocom-3.1/linenoise-1.0/linenoise.c:1068:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(new,history+(history_len-tocopy), sizeof(char*)*tocopy);
data/picocom-3.1/linenoise-1.0/linenoise.c:1081:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    FILE *fp = fopen(filename,"w");
data/picocom-3.1/linenoise-1.0/linenoise.c:1097:16:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    FILE *fp = fopen(filename,"r");
data/picocom-3.1/linenoise-1.0/linenoise.c:1098: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[LINENOISE_MAX_LINE];
data/picocom-3.1/picocom.c:205: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 send_cmd[128];
data/picocom-3.1/picocom.c:206: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 receive_cmd[128];
data/picocom-3.1/picocom.c:303:1:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
char lockname[_POSIX_PATH_MAX] = "";
data/picocom-3.1/picocom.c:332: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[16];
data/picocom-3.1/picocom.c:337: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).
    fd = open(lockname, O_RDONLY);
data/picocom-3.1/picocom.c:358: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).
    fd = open(lockname, O_WRONLY|O_CREAT|O_EXCL, 0666);
data/picocom-3.1/picocom.c:435: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 fname[_POSIX_PATH_MAX];
data/picocom-3.1/picocom.c:450: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 baudstr[9], *ep;
data/picocom-3.1/picocom.c:472: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 hexstr[256];
data/picocom-3.1/picocom.c:517:17:  [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(fullpath, dirn, dirlen + 1);
data/picocom-3.1/picocom.c:549:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(history_file_path, home_directory, home_directory_len + 1);
data/picocom-3.1/picocom.c:825: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 b[M_MAXMAP];
data/picocom-3.1/picocom.c:1131:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char *argv[RUNCMD_ARGS_MAX + 1];
data/picocom-3.1/picocom.c:1217: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 hexbuf[HEXBUF_SZ];
data/picocom-3.1/picocom.c:1454: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.
            char buff_rd[STI_RD_SZ];
data/picocom-3.1/picocom.c:1506: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.
            char buff_rd[TTY_RD_SZ];
data/picocom-3.1/picocom.c:1507: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.
            char buff_map[TTY_RD_SZ * M_MAXMAP];
data/picocom-3.1/picocom.c:1801: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).
            opts.baud = atoi(optarg);
data/picocom-3.1/picocom.c:2061:18:  [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).
        log_fd = open(opts.log_filename,
data/picocom-3.1/picocom.c:2068:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    tty_fd = open(opts.port, O_RDWR | O_NONBLOCK | O_NOCTTY);
data/picocom-3.1/split.c:89: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 arg_buff[MAX_ARG_LEN]; /* current argument buffer */
data/picocom-3.1/split.c:201: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 *my_argv[12];
data/picocom-3.1/term.c:123: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 term_err_buff[1024];
data/picocom-3.1/termios2.c:84: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(&t2.c_cc[0], &tios->c_cc[0], K_NCCS * sizeof (cc_t));
data/picocom-3.1/termios2.c:106: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(&tios->c_cc[0], &t2.c_cc[0], K_NCCS * sizeof (cc_t));
data/picocom-3.1/fdio.c:125:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        r = read(fdi, &c, 1);
data/picocom-3.1/linenoise-1.0/linenoise.c:271:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (read(ifd,buf+i,1) != 1) break;
data/picocom-3.1/linenoise-1.0/linenoise.c:305: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 (write(ofd,seq,strlen(seq)) == -1) {
data/picocom-3.1/linenoise-1.0/linenoise.c:365: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).
                ls->len = ls->pos = strlen(lc.cvec[i]);
data/picocom-3.1/linenoise-1.0/linenoise.c:375:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            nread = read(ls->ifd,&c,1);
data/picocom-3.1/linenoise-1.0/linenoise.c:417:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    size_t len = strlen(str);
data/picocom-3.1/linenoise-1.0/linenoise.c:467: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).
    size_t plen = strlen(l->prompt);
data/picocom-3.1/linenoise-1.0/linenoise.c:486: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).
    abAppend(&ab,seq,strlen(seq));
data/picocom-3.1/linenoise-1.0/linenoise.c:488: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).
    abAppend(&ab,l->prompt,strlen(l->prompt));
data/picocom-3.1/linenoise-1.0/linenoise.c:492: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).
    abAppend(&ab,seq,strlen(seq));
data/picocom-3.1/linenoise-1.0/linenoise.c:495: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).
    abAppend(&ab,seq,strlen(seq));
data/picocom-3.1/linenoise-1.0/linenoise.c:506: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).
    int plen = strlen(l->prompt);
data/picocom-3.1/linenoise-1.0/linenoise.c:524: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).
        abAppend(&ab,seq,strlen(seq));
data/picocom-3.1/linenoise-1.0/linenoise.c:531: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).
        abAppend(&ab,seq,strlen(seq));
data/picocom-3.1/linenoise-1.0/linenoise.c:537: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).
    abAppend(&ab,seq,strlen(seq));
data/picocom-3.1/linenoise-1.0/linenoise.c:540: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).
    abAppend(&ab,l->prompt,strlen(l->prompt));
data/picocom-3.1/linenoise-1.0/linenoise.c:552: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).
        abAppend(&ab,seq,strlen(seq));
data/picocom-3.1/linenoise-1.0/linenoise.c:565: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).
        abAppend(&ab,seq,strlen(seq));
data/picocom-3.1/linenoise-1.0/linenoise.c:575: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).
    abAppend(&ab,seq,strlen(seq));
data/picocom-3.1/linenoise-1.0/linenoise.c:673:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(l->buf,history[history_len - 1 - l->history_index],l->buflen);
data/picocom-3.1/linenoise-1.0/linenoise.c:675:27:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        l->len = l->pos = strlen(l->buf);
data/picocom-3.1/linenoise-1.0/linenoise.c:737: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).
    l.plen = strlen(prompt);
data/picocom-3.1/linenoise-1.0/linenoise.c:758:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        nread = read(l.ifd,&c,1);
data/picocom-3.1/linenoise-1.0/linenoise.c:825:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (read(l.ifd,seq,1) == -1) break;
data/picocom-3.1/linenoise-1.0/linenoise.c:826:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (read(l.ifd,seq+1,1) == -1) break;
data/picocom-3.1/linenoise-1.0/linenoise.c:832:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                    if (read(l.ifd,seq+2,1) == -1) break;
data/picocom-3.1/linenoise-1.0/linenoise.c:921:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        nread = read(STDIN_FILENO,&c,1);
data/picocom-3.1/linenoise-1.0/linenoise.c:947:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        count = strlen(buf);
data/picocom-3.1/linenoise-1.0/linenoise.c:977: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).
        len = strlen(buf);
data/picocom-3.1/picocom.c:339:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        r = read(fd, buf, sizeof(buf));
data/picocom-3.1/picocom.c:357:9:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    m = umask(022);
data/picocom-3.1/picocom.c:360:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(m);
data/picocom-3.1/picocom.c:362:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    write(fd, buf, strlen(buf));
data/picocom-3.1/picocom.c:506: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).
    dirlen = strlen(dirn);
data/picocom-3.1/picocom.c:508: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).
    baselen = strlen(basen);
data/picocom-3.1/picocom.c:513: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).
            namelen = strlen(dp->d_name);
data/picocom-3.1/picocom.c:519:21:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
                    strcat(fullpath, "/");
data/picocom-3.1/picocom.c:520:17:  [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(fullpath, dp->d_name, namelen);
data/picocom-3.1/picocom.c:523:25:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
                        strcat(fullpath, "/");
data/picocom-3.1/picocom.c:547: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).
        home_directory_len = strlen(home_directory);
data/picocom-3.1/picocom.c:548: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).
        history_file_path = malloc(home_directory_len + 2 + strlen(HISTFILE));
data/picocom-3.1/picocom.c:551:13:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
            strcat(history_file_path, "/");
data/picocom-3.1/picocom.c:999:12:  [1] (buffer) mismatch:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
    return mismatch;
data/picocom-3.1/picocom.c:1459:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                n = read(STI, buff_rd, sizeof(buff_rd));
data/picocom-3.1/picocom.c:1512:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                n = read(tty_fd, &buff_rd, sizeof(buff_rd));
data/picocom-3.1/picocom.c:1733:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(opts.send_cmd, optarg, sizeof(opts.send_cmd));
data/picocom-3.1/picocom.c:1737:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(opts.receive_cmd, optarg, sizeof(opts.receive_cmd));
data/picocom-3.1/picocom.c:1981: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).
               (unsigned long)strlen(opts.initstring));
data/picocom-3.1/picocom.c:2153:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            l = strlen(opts.initstring);
data/picocom-3.1/term.c:1617:28:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        if ( DRAIN_DELAY ) usleep(DRAIN_DELAY);
data/picocom-3.1/term.c:1669:28:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
        if ( DRAIN_DELAY ) usleep(DRAIN_DELAY);

ANALYSIS SUMMARY:

Hits = 101
Lines analyzed = 7309 in approximately 0.21 seconds (34770 lines/second)
Physical Source Lines of Code (SLOC) = 4685
Hits@level = [0] 140 [1]  51 [2]  42 [3]   3 [4]   5 [5]   0
Hits@level+ = [0+] 241 [1+] 101 [2+]  50 [3+]   8 [4+]   5 [5+]   0
Hits/KSLOC@level+ = [0+] 51.4408 [1+] 21.5582 [2+] 10.6724 [3+] 1.70758 [4+] 1.06724 [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.