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/libdogleg-0.14/dogleg.c
Examining data/libdogleg-0.14/dogleg.h
Examining data/libdogleg-0.14/sample.c

FINAL RESULTS:

data/libdogleg-0.14/dogleg.c:22:33:  [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.
#define SAY_NONEWLINE(fmt, ...) fprintf(stderr, "libdogleg at %s:%d: " fmt, __FILE__, __LINE__, ## __VA_ARGS__)
data/libdogleg-0.14/dogleg.c:968:13:  [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.
  int ret = vfprintf(stderr, s, ap);
data/libdogleg-0.14/sample.c:58: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.
      ((double)random() / (double)RAND_MAX - 0.5) * 1.0; // +- 0.5 units of uniformly-random noise
data/libdogleg-0.14/sample.c:192: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( 0 ); // I want determinism here
data/libdogleg-0.14/sample.c:204:21:  [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.
    p[i] = ((double)random() / (double)RAND_MAX - 0.1) * 1.0; // +- 0.1 units of uniformly-random noise
data/libdogleg-0.14/dogleg.c:248: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(p, p0, Nstate * sizeof(double));
data/libdogleg-0.14/dogleg.c:548: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( point->updateGN_dense, point->Jt_x, ctx->Nstate * sizeof(point->updateGN_dense[0]));
data/libdogleg-0.14/dogleg.c:1045: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->beforeStep->p, p, Nstate * sizeof(double));
data/libdogleg-0.14/dogleg.c:1053: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(p, ctx->beforeStep->p, Nstate * sizeof(double));

ANALYSIS SUMMARY:

Hits = 9
Lines analyzed = 1509 in approximately 0.04 seconds (36448 lines/second)
Physical Source Lines of Code (SLOC) = 1000
Hits@level = [0]  15 [1]   0 [2]   4 [3]   3 [4]   2 [5]   0
Hits@level+ = [0+]  24 [1+]   9 [2+]   9 [3+]   5 [4+]   2 [5+]   0
Hits/KSLOC@level+ = [0+]  24 [1+]   9 [2+]   9 [3+]   5 [4+]   2 [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.