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/r-cran-rgdal-1.5-18+dfsg/src/ogr_geom.cpp
Examining data/r-cran-rgdal-1.5-18+dfsg/src/rgdal.h
Examining data/r-cran-rgdal-1.5-18+dfsg/src/local_stubs.c
Examining data/r-cran-rgdal-1.5-18+dfsg/src/ogr_polygons.c
Examining data/r-cran-rgdal-1.5-18+dfsg/src/ogrdrivers.cpp
Examining data/r-cran-rgdal-1.5-18+dfsg/src/init.c
Examining data/r-cran-rgdal-1.5-18+dfsg/src/proj_network7.cpp
Examining data/r-cran-rgdal-1.5-18+dfsg/src/projectit.cpp
Examining data/r-cran-rgdal-1.5-18+dfsg/src/inverser.c
Examining data/r-cran-rgdal-1.5-18+dfsg/src/OGR_write.cpp
Examining data/r-cran-rgdal-1.5-18+dfsg/src/ogr_proj.cpp
Examining data/r-cran-rgdal-1.5-18+dfsg/src/proj6.cpp
Examining data/r-cran-rgdal-1.5-18+dfsg/src/ogrsource.cpp
Examining data/r-cran-rgdal-1.5-18+dfsg/src/gdal-bindings.cpp
Examining data/r-cran-rgdal-1.5-18+dfsg/src/proj_info6.cpp
Examining data/r-cran-rgdal-1.5-18+dfsg/inst/include/projects.h

FINAL RESULTS:

data/r-cran-rgdal-1.5-18+dfsg/inst/include/projects.h:92:11:  [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.
#  define getenv wceex_getenv
data/r-cran-rgdal-1.5-18+dfsg/inst/include/projects.h:215:2:  [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 param[1]; } paralist;
data/r-cran-rgdal-1.5-18+dfsg/inst/include/projects.h:258:9:  [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    axis[4];
data/r-cran-rgdal-1.5-18+dfsg/inst/include/projects.h:334:2:  [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 id[MAX_TAB_ID]; /* ascii info */
data/r-cran-rgdal-1.5-18+dfsg/src/gdal-bindings.cpp:44:8:  [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 char saved_error_msg[2048];
data/r-cran-rgdal-1.5-18+dfsg/src/ogrsource.cpp:682: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.
                char szItem[32];
data/r-cran-rgdal-1.5-18+dfsg/src/proj6.cpp:1046:12:  [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).
    fptf = fopen(CHAR(STRING_ELT(tf, 0)), "wb");
data/r-cran-rgdal-1.5-18+dfsg/src/proj_info6.cpp:40:12:  [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).
    fptf = fopen(CHAR(STRING_ELT(tf, 0)), "wb");
data/r-cran-rgdal-1.5-18+dfsg/src/projectit.cpp:219: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 buf[MAX_LINE_LEN+1];   /* input buffer */
data/r-cran-rgdal-1.5-18+dfsg/src/projectit.cpp:229: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("C:\\OSGeo4W\\share\\proj\\epsg", "rb");
data/r-cran-rgdal-1.5-18+dfsg/src/projectit.cpp:242:16:  [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).
        fptf = fopen(CHAR(STRING_ELT(tf, 0)), "wb");
data/r-cran-rgdal-1.5-18+dfsg/src/gdal-bindings.cpp:209:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy(saved_error_msg, msg, sizeof(saved_error_msg));
data/r-cran-rgdal-1.5-18+dfsg/src/gdal-bindings.cpp:879:7:  [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).
  if (strlen(pszSRS_WKT) == 0) {

ANALYSIS SUMMARY:

Hits = 13
Lines analyzed = 8488 in approximately 0.19 seconds (44128 lines/second)
Physical Source Lines of Code (SLOC) = 6429
Hits@level = [0]   5 [1]   2 [2]  10 [3]   1 [4]   0 [5]   0
Hits@level+ = [0+]  18 [1+]  13 [2+]  11 [3+]   1 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 2.79981 [1+] 2.02209 [2+] 1.711 [3+] 0.155545 [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.