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/haskell-hmatrix-0.20.0.0/src/Internal/C/lapack-aux.c
Examining data/haskell-hmatrix-0.20.0.0/src/Internal/C/lapack-aux.h
Examining data/haskell-hmatrix-0.20.0.0/src/Internal/C/vector-aux.c

FINAL RESULTS:

data/haskell-hmatrix-0.20.0.0/src/Internal/C/lapack-aux.c:86:9:  [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.
        printf(msg);                         \
data/haskell-hmatrix-0.20.0.0/src/Internal/C/lapack-aux.c:98:9:  [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.
        printf(msg);                         \
data/haskell-hmatrix-0.20.0.0/src/Internal/C/lapack-aux.c:1776: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(fp,format,AT(a,r,c));
data/haskell-hmatrix-0.20.0.0/src/Internal/C/vector-aux.c:956: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.
    state[0] = random();
data/haskell-hmatrix-0.20.0.0/src/Internal/C/vector-aux.c:957: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.
    state[1] = random();
data/haskell-hmatrix-0.20.0.0/src/Internal/C/vector-aux.c:958: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.
    state[2] = random();
data/haskell-hmatrix-0.20.0.0/src/Internal/C/vector-aux.c:961:20:  [3] (random) nrand48:
  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 (double)nrand48(state) / (double)max_random;
data/haskell-hmatrix-0.20.0.0/src/Internal/C/vector-aux.c:1012:5:  [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.
    srand(seed);
data/haskell-hmatrix-0.20.0.0/src/Internal/C/vector-aux.c:1039: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(seed);
data/haskell-hmatrix-0.20.0.0/src/Internal/C/lapack-aux.c:64:21:  [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 buf[108];
data/haskell-hmatrix-0.20.0.0/src/Internal/C/lapack-aux.c:1772:10:  [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).
    fp = fopen (file, "w");
data/haskell-hmatrix-0.20.0.0/src/Internal/C/vector-aux.c:906:10:  [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).
    fp = fopen (file, "r");
data/haskell-hmatrix-0.20.0.0/src/Internal/C/vector-aux.c:1101: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   random_state[128];
data/haskell-hmatrix-0.20.0.0/src/Internal/C/vector-aux.c:1141: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(rp,vp,vn*sizeof(double));
data/haskell-hmatrix-0.20.0.0/src/Internal/C/vector-aux.c:1152: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(rp,vp,vn*sizeof(float));
data/haskell-hmatrix-0.20.0.0/src/Internal/C/vector-aux.c:1163: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(rp,vp,vn*sizeof(int));
data/haskell-hmatrix-0.20.0.0/src/Internal/C/vector-aux.c:1174: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(rp,vp,vn*sizeof(int64_t));

ANALYSIS SUMMARY:

Hits = 17
Lines analyzed = 3484 in approximately 0.29 seconds (12043 lines/second)
Physical Source Lines of Code (SLOC) = 2890
Hits@level = [0]  11 [1]   0 [2]   8 [3]   6 [4]   3 [5]   0
Hits@level+ = [0+]  28 [1+]  17 [2+]  17 [3+]   9 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 9.68858 [1+] 5.88235 [2+] 5.88235 [3+] 3.11419 [4+] 1.03806 [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.