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/libgfshare-2.0.0/tools/gfsplit.c
Examining data/libgfshare-2.0.0/tools/gfcombine.c
Examining data/libgfshare-2.0.0/src/libgfshare.c
Examining data/libgfshare-2.0.0/src/gfshare_maketable.c
Examining data/libgfshare-2.0.0/libgfshare_tables.h
Examining data/libgfshare-2.0.0/include/libgfshare.h
Examining data/libgfshare-2.0.0/tests/test_gfshare_isfield.c
Examining data/libgfshare-2.0.0/tests/test_gfshare_blockwise_simple.c

FINAL RESULTS:

data/libgfshare-2.0.0/tools/gfsplit.c:112:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf( outputfilebuffer, "%s.%03d", _outputstem, proposed );
data/libgfshare-2.0.0/tools/gfsplit.c:164:7:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
  if (access("/dev/urandom", R_OK) == 0) {
data/libgfshare-2.0.0/src/libgfshare.c:52:18:  [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.
    buffer[i] = (random() & 0xff00) >> 8; /* apparently the bottom 8 aren't
data/libgfshare-2.0.0/tests/test_gfshare_blockwise_simple.c:49:18:  [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.
    secret[i] = (random() & 0xff00) >> 8;
data/libgfshare-2.0.0/tools/gfcombine.c:172:19:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while( (optnr = getopt(argc, argv, OPTSTRING)) != -1 ) {
data/libgfshare-2.0.0/tools/gfsplit.c:99:31:  [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.
    unsigned char proposed = (random() & 0xff00) >> 8;
data/libgfshare-2.0.0/tools/gfsplit.c:162: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(NULL) );
data/libgfshare-2.0.0/tools/gfsplit.c:172:19:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while( (optnr = getopt(argc, argv, OPTSTRING)) != -1 ) {
data/libgfshare-2.0.0/libgfshare_tables.h:5:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static unsigned char logs[256] = {
data/libgfshare-2.0.0/libgfshare_tables.h:39:17:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static unsigned char exps[510] = {
data/libgfshare-2.0.0/src/gfshare_maketable.c:35:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char logs[256];
data/libgfshare-2.0.0/src/gfshare_maketable.c:36:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char exps[255];
data/libgfshare-2.0.0/src/libgfshare.c:87: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( ctx->sharenrs, sharenrs, sharecount );
data/libgfshare-2.0.0/src/libgfshare.c:157: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( ctx->buffer + ((ctx->threshold-1) * ctx->size),
data/libgfshare-2.0.0/src/libgfshare.c:196: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( ctx->sharenrs, sharenrs, ctx->sharecount );
data/libgfshare-2.0.0/src/libgfshare.c:207: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( ctx->buffer + (sharenr * ctx->size), share, ctx->size );
data/libgfshare-2.0.0/tools/gfcombine.c:111:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    outfile = fopen( outputfilename, "wb" );
data/libgfshare-2.0.0/tools/gfcombine.c:118:21:  [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).
    inputfiles[i] = fopen( inputfilenames[i], "rb" );
data/libgfshare-2.0.0/tools/gfsplit.c:30:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  devrandom = fopen("/dev/urandom", "rb");
data/libgfshare-2.0.0/tools/gfsplit.c:93:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  inputfile = fopen( _inputfile, "rb" );
data/libgfshare-2.0.0/tools/gfsplit.c:113:22:  [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).
    outputfiles[i] = fopen( outputfilebuffer, "wb" );
data/libgfshare-2.0.0/tools/gfcombine.c:70: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 nlen = strlen(filenames[i]);
data/libgfshare-2.0.0/tools/gfcombine.c:123: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).
    sharenrs[i] = strtoul( inputfilenames[i] + strlen(inputfilenames[i]) - 3, 
data/libgfshare-2.0.0/tools/gfcombine.c:200: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).
    outputfile[strlen(outputfile)-4] = 0;
data/libgfshare-2.0.0/tools/gfsplit.c:84: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).
  char* outputfilebuffer = malloc( strlen(_outputstem) + 5 );

ANALYSIS SUMMARY:

Hits = 25
Lines analyzed = 1198 in approximately 0.23 seconds (5158 lines/second)
Physical Source Lines of Code (SLOC) = 809
Hits@level = [0]  31 [1]   4 [2]  13 [3]   6 [4]   2 [5]   0
Hits@level+ = [0+]  56 [1+]  25 [2+]  21 [3+]   8 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+] 69.2213 [1+] 30.9023 [2+] 25.958 [3+] 9.88875 [4+] 2.47219 [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.