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/why3-1.3.3/examples/multiprecision/overlays/add.h
Examining data/why3-1.3.3/examples/multiprecision/overlays/mul.h
Examining data/why3-1.3.3/examples/multiprecision/overlays/sub.h
Examining data/why3-1.3.3/examples/multiprecision/overlays/uint64gmp.h
Examining data/why3-1.3.3/examples/multiprecision/tests.c
Examining data/why3-1.3.3/examples/multiprecision/wmp.h
Examining data/why3-1.3.3/plugins/microc/test.c
Examining data/why3-1.3.3/src/ide/resetgc.c
Examining data/why3-1.3.3/src/jessie/tests/basic/app.c
Examining data/why3-1.3.3/src/jessie/tests/basic/array.c
Examining data/why3-1.3.3/src/jessie/tests/basic/axiomatic.c
Examining data/why3-1.3.3/src/jessie/tests/basic/call.c
Examining data/why3-1.3.3/src/jessie/tests/basic/constants.c
Examining data/why3-1.3.3/src/jessie/tests/basic/forty-two.c
Examining data/why3-1.3.3/src/jessie/tests/basic/generic.c
Examining data/why3-1.3.3/src/jessie/tests/basic/global.c
Examining data/why3-1.3.3/src/jessie/tests/basic/incr.c
Examining data/why3-1.3.3/src/jessie/tests/basic/lemma.c
Examining data/why3-1.3.3/src/jessie/tests/basic/rec.c
Examining data/why3-1.3.3/src/jessie/tests/demo/array_max.c
Examining data/why3-1.3.3/src/jessie/tests/demo/binary_search.c
Examining data/why3-1.3.3/src/jessie/tests/demo/f91.c
Examining data/why3-1.3.3/src/jessie/tests/demo/flag.c
Examining data/why3-1.3.3/src/jessie/tests/demo/isqrt.c
Examining data/why3-1.3.3/src/jessie/tests/demo/mccarthy.c
Examining data/why3-1.3.3/src/jessie/tests/demo/selection_sort.c
Examining data/why3-1.3.3/src/jessie/tests/demo/sparse_array.c
Examining data/why3-1.3.3/src/jessie/tests/demo/triangle.c
Examining data/why3-1.3.3/src/server/arraylist.c
Examining data/why3-1.3.3/src/server/arraylist.h
Examining data/why3-1.3.3/src/server/cpulimit-unix.c
Examining data/why3-1.3.3/src/server/cpulimit-win.c
Examining data/why3-1.3.3/src/server/logging.c
Examining data/why3-1.3.3/src/server/logging.h
Examining data/why3-1.3.3/src/server/options.c
Examining data/why3-1.3.3/src/server/options.h
Examining data/why3-1.3.3/src/server/proc.c
Examining data/why3-1.3.3/src/server/proc.h
Examining data/why3-1.3.3/src/server/queue.c
Examining data/why3-1.3.3/src/server/queue.h
Examining data/why3-1.3.3/src/server/readbuf.c
Examining data/why3-1.3.3/src/server/readbuf.h
Examining data/why3-1.3.3/src/server/request.c
Examining data/why3-1.3.3/src/server/request.h
Examining data/why3-1.3.3/src/server/server-unix.c
Examining data/why3-1.3.3/src/server/server-win.c
Examining data/why3-1.3.3/src/server/writebuf.c
Examining data/why3-1.3.3/src/server/writebuf.h

FINAL RESULTS:

data/why3-1.3.3/src/server/cpulimit-unix.c:147:3:  [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[4],argv+4);
data/why3-1.3.3/src/server/cpulimit-win.c:117:5:  [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(p, argv[i]);
data/why3-1.3.3/src/server/logging.c:30:5:  [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(logfile, fmt, va);
data/why3-1.3.3/src/server/logging.h:17:52:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
void log_msg(char* s, ...) __attribute__ ((format (printf, 1, 2)));
data/why3-1.3.3/src/server/server-unix.c:136: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(template, dir);
data/why3-1.3.3/src/server/server-unix.c:359:3:  [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(cmd,unix_argv);
data/why3-1.3.3/src/server/server-win.c:287:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy (cmd, r->cmd);
data/why3-1.3.3/src/server/server-win.c:366:14:  [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 (cmd, ca);
data/why3-1.3.3/src/server/server-win.c:630:4:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
   strcpy(pipe_name, TEXT("\\\\.\\pipe\\"));
data/why3-1.3.3/src/server/server-win.c:631:4:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
   strcat(pipe_name, my_pipe_name);
data/why3-1.3.3/src/server/cpulimit-win.c:148:7:  [3] (shell) CreateProcess:
  This causes a new process to execute and is difficult to use safely
  (CWE-78). Specify the application path in the first argument, NOT as part
  of the second, or embedded spaces could allow an attacker to force a
  different program to run.
  if(!CreateProcess(NULL,p,NULL,NULL,FALSE,CREATE_SUSPENDED,NULL,NULL,&si,&pi))
data/why3-1.3.3/src/server/cpulimit-win.c:148:7:  [3] (shell) CreateProcess:
  This causes a new process to execute and is difficult to use safely
  (CWE-78). Specify the application path in the first argument, NOT as part
  of the second, or embedded spaces could allow an attacker to force a
  different program to run.
  if(!CreateProcess(NULL,p,NULL,NULL,FALSE,CREATE_SUSPENDED,NULL,NULL,&si,&pi))
data/why3-1.3.3/src/server/options.c:35:10:  [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, "j:s:",
data/why3-1.3.3/src/server/server-win.c:217:10:  [3] (tmpfile) GetTempFileName:
  Temporary file race condition in certain cases (e.g., if run as SYSTEM in
  many versions of Windows) (CWE-377).
   res = GetTempFileName(current_dir, TEXT("vcout"), 0, *outfile);
data/why3-1.3.3/src/server/server-win.c:395:8:  [3] (shell) CreateProcess:
  This causes a new process to execute and is difficult to use safely
  (CWE-78). Specify the application path in the first argument, NOT as part
  of the second, or embedded spaces could allow an attacker to force a
  different program to run.
   if(!CreateProcess(NULL,
data/why3-1.3.3/src/server/server-win.c:395:8:  [3] (shell) CreateProcess:
  This causes a new process to execute and is difficult to use safely
  (CWE-78). Specify the application path in the first argument, NOT as part
  of the second, or embedded spaces could allow an attacker to force a
  different program to run.
   if(!CreateProcess(NULL,
data/why3-1.3.3/src/server/cpulimit-unix.c:72:15:  [2] (integer) atol:
  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).
  timelimit = atol(argv[1]);
data/why3-1.3.3/src/server/cpulimit-unix.c:76:14:  [2] (integer) atol:
  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).
  memlimit = atol(argv[2]);
data/why3-1.3.3/src/server/logging.c:22:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
   logfile = fopen("why3server.log", "w");
data/why3-1.3.3/src/server/queue.c:51: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(q->data + new_p,
data/why3-1.3.3/src/server/readbuf.c:48: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(b->data, b->data+size, b->len - size);
data/why3-1.3.3/src/server/request.c:51: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((*result), buf + begin, i - begin);
data/why3-1.3.3/src/server/request.c:79:22:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
      parallel_arg = atoi(tmp);
data/why3-1.3.3/src/server/request.c:117:18:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  req->timeout = atoi(tmp);
data/why3-1.3.3/src/server/request.c:120:19:  [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).
  req->memlimit = atoi(tmp);
data/why3-1.3.3/src/server/server-unix.c:137:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
  strcat(template, "/why3");
data/why3-1.3.3/src/server/server-unix.c:138:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
  strcat(template, "XXXXXX");
data/why3-1.3.3/src/server/server-unix.c:140:10:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
  return mkstemp(template);
data/why3-1.3.3/src/server/server-unix.c:230:13:  [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).
  cur_dir = open(".", O_RDONLY);
data/why3-1.3.3/src/server/server-unix.c:249: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(addr.sun_path, filen, strlen(filen) + 1);
data/why3-1.3.3/src/server/server-unix.c:349: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).
    int infile = open(argv[count], O_RDONLY);
data/why3-1.3.3/src/server/server-win.c:75: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 current_dir[MAX_PATH];
data/why3-1.3.3/src/server/server-win.c:235:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (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 cmd[4096];
data/why3-1.3.3/src/server/cpulimit-win.c:103: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).
    s += strlen(argv[i]) + 3;
data/why3-1.3.3/src/server/cpulimit-win.c:116:5:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
    strcat(p, "\"");
data/why3-1.3.3/src/server/cpulimit-win.c:118:5:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
    strcat(p, "\"");
data/why3-1.3.3/src/server/cpulimit-win.c:119:23:  [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.
    if (i < argc - 1) strcat(p, " ");
data/why3-1.3.3/src/server/server-unix.c:134: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(dir);
data/why3-1.3.3/src/server/server-unix.c:246:7:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (strlen(filen) + 1 > unix_path_max()) {
data/why3-1.3.3/src/server/server-unix.c:249: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).
  memcpy(addr.sun_path, filen, strlen(filen) + 1);
data/why3-1.3.3/src/server/server-unix.c:385:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   len += strlen(id) + 4;
data/why3-1.3.3/src/server/server-unix.c:409:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   len += strlen(id) + 3;
data/why3-1.3.3/src/server/server-unix.c:414:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   len+= strlen(outfile) + 1;
data/why3-1.3.3/src/server/server-unix.c:568:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  num_read = read(client->fd, buf, READ_ONCE);
data/why3-1.3.3/src/server/server-unix.c:610:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while ((res = read(cpipe[0], &ch, 1)) == -1 && errno == EINTR)
data/why3-1.3.3/src/server/server-win.c:60:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   t_conn_data read;
data/why3-1.3.3/src/server/server-win.c:288:4:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
   strcat (cmd, " ");
data/why3-1.3.3/src/server/server-win.c:298: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).
         if (strlen(ca) > 0)
data/why3-1.3.3/src/server/server-win.c:301: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).
         for (int ca_index = 0; ca_index < strlen(ca); ca_index++)
data/why3-1.3.3/src/server/server-win.c:315: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 cl_index = strlen(cmd);
data/why3-1.3.3/src/server/server-win.c:320:48:  [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 (int ca_index = 0; ca_index < strlen(ca); ca_index++)
data/why3-1.3.3/src/server/server-win.c:347: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).
                     if (ca[ca_index] == '\\' && ca_index + 1 == strlen(ca))
data/why3-1.3.3/src/server/server-win.c:367:14:  [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 (cmd, " ");
data/why3-1.3.3/src/server/server-win.c:478:37:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            (LPOVERLAPPED) &client->read);
data/why3-1.3.3/src/server/server-win.c:489:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   init_connect_data(&(client->read), READOP);
data/why3-1.3.3/src/server/server-win.c:503:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   len += strlen(id) + 4;
data/why3-1.3.3/src/server/server-win.c:529:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   len += strlen(id) + 3;
data/why3-1.3.3/src/server/server-win.c:534:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   len+= strlen(outfile) + 1;
data/why3-1.3.3/src/server/server-win.c:629:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
   pipe_name = (char*) malloc(sizeof(char) * (strlen(my_pipe_name) + 10));
data/why3-1.3.3/src/server/writebuf.c:47: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).
         b->len = strlen(b->data);
data/why3-1.3.3/src/server/writebuf.c:69: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).
      b->len = strlen(data);

ANALYSIS SUMMARY:

Hits = 61
Lines analyzed = 5377 in approximately 1.12 seconds (4814 lines/second)
Physical Source Lines of Code (SLOC) = 3710
Hits@level = [0] 160 [1]  28 [2]  17 [3]   6 [4]  10 [5]   0
Hits@level+ = [0+] 221 [1+]  61 [2+]  33 [3+]  16 [4+]  10 [5+]   0
Hits/KSLOC@level+ = [0+] 59.5687 [1+] 16.442 [2+] 8.89488 [3+] 4.31267 [4+] 2.69542 [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.