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/libsharp-1.0.0/c_utils/c_utils.h
Examining data/libsharp-1.0.0/c_utils/walltime_c.c
Examining data/libsharp-1.0.0/c_utils/memusage.c
Examining data/libsharp-1.0.0/c_utils/memusage.h
Examining data/libsharp-1.0.0/c_utils/c_utils.c
Examining data/libsharp-1.0.0/c_utils/walltime_c.h
Examining data/libsharp-1.0.0/pocketfft/pocketfft.h
Examining data/libsharp-1.0.0/pocketfft/pocketfft.c
Examining data/libsharp-1.0.0/libsharp/sharp.c
Examining data/libsharp-1.0.0/libsharp/sharp_ylmgen_c.c
Examining data/libsharp-1.0.0/libsharp/sharp.h
Examining data/libsharp-1.0.0/libsharp/sharp_core_inc.c
Examining data/libsharp-1.0.0/libsharp/sharp_geomhelpers.h
Examining data/libsharp-1.0.0/libsharp/sharp_legendre_roots.c
Examining data/libsharp-1.0.0/libsharp/sharp_almhelpers.c
Examining data/libsharp-1.0.0/libsharp/sharp_internal.h
Examining data/libsharp-1.0.0/libsharp/sharp_almhelpers.h
Examining data/libsharp-1.0.0/libsharp/sharp_testsuite.c
Examining data/libsharp-1.0.0/libsharp/sharp_geomhelpers.c
Examining data/libsharp-1.0.0/libsharp/sharp_ylmgen_c.h
Examining data/libsharp-1.0.0/libsharp/sharp_cxx.h
Examining data/libsharp-1.0.0/libsharp/sharp_core.c
Examining data/libsharp-1.0.0/libsharp/sharp_vecsupport.h
Examining data/libsharp-1.0.0/libsharp/sharp_legendre_roots.h

FINAL RESULTS:

data/libsharp-1.0.0/libsharp/sharp_testsuite.c:649:7:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
      getenv("HOST"),argv[2],spin,sharp_veclen(),nomp,ntasks,lmax,mmax,gpar1,gpar2,
data/libsharp-1.0.0/c_utils/memusage.c:34:17:  [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 *statm = fopen("/proc/self/statm","r");
data/libsharp-1.0.0/c_utils/memusage.c:45: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 word[1024];
data/libsharp-1.0.0/c_utils/memusage.c:46:13:  [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 *f = fopen("/proc/self/status", "r");
data/libsharp-1.0.0/libsharp/sharp.c:670:11:  [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(p1,p2,ri->nph*sizeof(double));
data/libsharp-1.0.0/libsharp/sharp.c:695:9:  [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(p1,p2,ri->nph*sizeof(double));
data/libsharp-1.0.0/libsharp/sharp_testsuite.c:573:12:  [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 lmax=atoi(argv[3]);
data/libsharp-1.0.0/libsharp/sharp_testsuite.c:574:12:  [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 mmax=atoi(argv[4]);
data/libsharp-1.0.0/libsharp/sharp_testsuite.c:575:13:  [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 gpar1=atoi(argv[5]);
data/libsharp-1.0.0/libsharp/sharp_testsuite.c:576:13:  [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 gpar2=atoi(argv[6]);
data/libsharp-1.0.0/libsharp/sharp_testsuite.c:577:12:  [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 spin=atoi(argv[7]);
data/libsharp-1.0.0/pocketfft/pocketfft.c:918:7:  [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 (c,p1,len*sizeof(cmplx));
data/libsharp-1.0.0/pocketfft/pocketfft.c:1692:7:  [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 (c,p1,n*sizeof(double));
data/libsharp-1.0.0/pocketfft/pocketfft.c:2026: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 (tmp+2,c+1, (n-1)*sizeof(double));
data/libsharp-1.0.0/pocketfft/pocketfft.c:2055: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 (c+1, tmp+2, (n-1)*sizeof(double));
data/libsharp-1.0.0/c_utils/memusage.c:51:9:  [1] (buffer) fscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
    if (fscanf (f,"%1023s",word)<0)
data/libsharp-1.0.0/c_utils/memusage.c:55:11:  [1] (buffer) fscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
      if (fscanf(f,"%lf%2s",&res,word)<0)
data/libsharp-1.0.0/libsharp/sharp_testsuite.c:72:18:  [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).
  size_t m, nlen=strlen(name);

ANALYSIS SUMMARY:

Hits = 18
Lines analyzed = 7518 in approximately 0.25 seconds (29586 lines/second)
Physical Source Lines of Code (SLOC) = 5956
Hits@level = [0]  42 [1]   3 [2]  14 [3]   1 [4]   0 [5]   0
Hits@level+ = [0+]  60 [1+]  18 [2+]  15 [3+]   1 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 10.0739 [1+] 3.02216 [2+] 2.51847 [3+] 0.167898 [4+]   0 [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.