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/ogamesim-20130107/csim/sim.c
Examining data/ogamesim-20130107/csim/report.h
Examining data/ogamesim-20130107/csim/main.c
Examining data/ogamesim-20130107/csim/report.c
Examining data/ogamesim-20130107/csim/units_info.c
Examining data/ogamesim-20130107/csim/unit.c
Examining data/ogamesim-20130107/csim/unit.h
Examining data/ogamesim-20130107/csim/parse_input.h
Examining data/ogamesim-20130107/csim/units_info.h
Examining data/ogamesim-20130107/csim/sim.h
Examining data/ogamesim-20130107/csim/random.h
Examining data/ogamesim-20130107/csim/parse_input.c
Examining data/ogamesim-20130107/csim/version.h

FINAL RESULTS:

data/ogamesim-20130107/csim/parse_input.c:79:27:  [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).
    while(buffer[i]==' ') strcpy(buffer+i, buffer+i+1);
data/ogamesim-20130107/csim/main.c:38:3:  [3] (random) srandom:
  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.
  srandom( time(&t) );
data/ogamesim-20130107/csim/parse_input.c:197:22:  [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.
  for (c=0; c!=-1; c=getopt(argc, argv, "i:o:s:ht:V"
data/ogamesim-20130107/csim/random.h:23:9:  [3] (random) srandom:
  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.
#define srandom(__x) srand((__x))
data/ogamesim-20130107/csim/random.h:23:22:  [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.
#define srandom(__x) srand((__x))
data/ogamesim-20130107/csim/random.h:24:9:  [3] (random) random:
  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.
#define random() ((rand()&0x7FFF)|((rand()&0x7FFF)<<15))
data/ogamesim-20130107/csim/sim.c:48:16:  [3] (random) random:
  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.
      int didx=random()%dcount;
data/ogamesim-20130107/csim/sim.c:668:5:  [3] (random) srandom:
  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.
    srandom(random());    // каждой дочке свой srand
data/ogamesim-20130107/csim/sim.c:668:13:  [3] (random) random:
  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.
    srandom(random());    // каждой дочке свой srand
data/ogamesim-20130107/csim/unit.c:81:13:  [3] (random) random:
  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.
        if (random()%100>level_boom)
data/ogamesim-20130107/csim/unit.c:109:14:  [3] (random) random:
  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.
      return random()<rapids[rid][i].chance*RAND_MAX;
data/ogamesim-20130107/csim/parse_input.c:126: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).
        int ivalue=atoi(value);
data/ogamesim-20130107/csim/parse_input.c:216:24:  [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).
        sim->work_time=atoi(optarg);
data/ogamesim-20130107/csim/parse_input.c:226:26:  [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).
        sim->forks_count=atoi(optarg);
data/ogamesim-20130107/csim/parse_input.c:255:26:  [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).
        sim->simulations=atoi(optarg);
data/ogamesim-20130107/csim/parse_input.c:268:18:  [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 *output=fopen(file_output, "wt");
data/ogamesim-20130107/csim/parse_input.c:287:18:  [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 * input=fopen(file_input, "rt");
data/ogamesim-20130107/csim/sim.c:314: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(result->attacker.unit, 
data/ogamesim-20130107/csim/sim.c:316: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(result->defender.unit, 
data/ogamesim-20130107/csim/unit.h:34: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 name[64];
data/ogamesim-20130107/csim/parse_input.c:82: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).
    int slen=strlen(buffer+i); if (!slen) continue;
data/ogamesim-20130107/csim/sim.c:730:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((read(sims[j].reader, &count, sizeof(int))!=sizeof(int))||
data/ogamesim-20130107/csim/sim.c:740:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if (read(sims[j].reader, sr, sizeof(sim_result))!=

ANALYSIS SUMMARY:

Hits = 23
Lines analyzed = 2350 in approximately 0.08 seconds (30204 lines/second)
Physical Source Lines of Code (SLOC) = 1621
Hits@level = [0]  44 [1]   3 [2]   9 [3]  10 [4]   1 [5]   0
Hits@level+ = [0+]  67 [1+]  23 [2+]  20 [3+]  11 [4+]   1 [5+]   0
Hits/KSLOC@level+ = [0+] 41.3325 [1+] 14.1888 [2+] 12.3381 [3+] 6.78593 [4+] 0.616903 [5+]   0
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.