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/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.h
Examining data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c
Examining data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcas.c
Examining data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.h
Examining data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_globus_internal.h
Examining data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcas.h
Examining data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c
Examining data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c

FINAL RESULTS:

data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:365:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
		strcpy(identity_buffer, local_identity);
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:443:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(identity_buffer, local_identity);
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:257:9:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    res=vsnprintf(buf,MAX_ERRORBUF_LEN,format,args);
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.h:92:27:  [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.
    __attribute__((format(printf,2,3)));
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:135:21:  [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.
    if ((run_lcas = getenv("LLGT_RUN_LCAS"))) {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:152:13:  [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.
        if (getenv ("LCAS_LOG_FILE")) {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:153:32:  [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.
            flog_lcas = fopen (getenv ("LCAS_LOG_FILE"), "a");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:157:25:  [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 ("LCAS_LOG_FILE"));
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:178:9:  [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.
    if (getenv ("LCMAPS_LOG_FILE")) {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:179:30:  [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.
        flog_lcmaps = fopen (getenv ("LCMAPS_LOG_FILE"), "a");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:183:21:  [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 ("LCMAPS_LOG_FILE"));
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:204:13:  [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.
        if (getenv("LLGT_LIFT_PRIVILEGED_PROTECTION")) {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:206:20:  [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.
        } else if (getenv("LLGT_NO_CHANGE_USER")) {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:208:20:  [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.
        } else if (getenv("LLGT4_NO_CHANGE_USER")) {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:342:25:  [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.
	 ( (llgt_cache_callout=getenv("LLGT_CACHE_CALLOUT"))!=NULL &&
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcas.c:80:19:  [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.
    lcas_libdir = getenv("LLGT_LCAS_LIBDIR");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcas.c:89:27:  [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.
        lcas_moddir_sfx = getenv("LLGT_LCAS_MODULEDIR_SFX");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcas.c:147:10:  [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.
    if (!getenv ("LCAS_DEBUG_LEVEL"))
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcas.c:150:10:  [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.
    if (!getenv ("LCAS_DB_FILE"))
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcas.c:156:10:  [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.
    if (!getenv ("LCAS_LOG_FILE"))
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcas.c:160:10:  [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.
    if (!getenv ("LCAS_DIR"))
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcas.c:310:28:  [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.
    if ((llgt_dlclose_lcas=getenv("LLGT_DLCLOSE_LCAS"))==NULL ||
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:100:21:  [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.
    lcmaps_libdir = getenv("LLGT_LCMAPS_LIBDIR");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:114:29:  [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.
        lcmaps_moddir_sfx = getenv("LLGT_LCMAPS_MODULEDIR_SFX");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:176:17:  [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.
    char *input=getenv("LCMAPS_POLICY_NAME");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:246:10:  [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.
    if (!getenv ("LCMAPS_DEBUG_LEVEL"))
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:252:10:  [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.
    if (!getenv ("LCMAPS_LOG_FILE"))
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:256:10:  [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.
    if (!getenv ("LCMAPS_DB_FILE"))
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:259:10:  [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.
    if (!getenv ("LCMAPS_DIR"))
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:265:10:  [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.
    if (!getenv ("LCMAPS_POLICY_NAME"))
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:309:37:  [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.
    const char *llgt_voms_disable = getenv("LLGT_VOMS_DISABLE_CREDENTIAL_CHECK");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:310:36:  [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.
    const char *llgt_voms_enable = getenv("LLGT_VOMS_ENABLE_CREDENTIAL_CHECK");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:523:30:  [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.
    if ((llgt_dlclose_lcmaps=getenv("LLGT_DLCLOSE_LCMAPS"))==NULL ||
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:104:9:  [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.
    if (getenv("LLGT_ENABLE_DEBUG")) {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:110:30:  [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.
    if ((syslog_log_prefix = getenv("LLGT_LOG_IDENT"))) {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:119:30:  [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.
    if ((llgt_log_facility = getenv("LLGT_LOG_FACILITY"))) {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:180:28:  [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.
    char *llgt_logfilename=getenv("LLGT_LOG_FILE");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:197:10:  [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.
	    if (getenv("LLGT_ENABLE_DEBUG")) {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:201:27:  [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.
	    if ( (llgt_log_ident=getenv("LLGT_LOG_IDENT")) == NULL)
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:207:10:  [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.
	    if (getenv("LCMAPS_LOG_FILE")==NULL)
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:210:10:  [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.
	    if (getenv("LCAS_LOG_FILE")==NULL)
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:153:25:  [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).
            flog_lcas = fopen (getenv ("LCAS_LOG_FILE"), "a");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:179:23:  [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).
        flog_lcmaps = fopen (getenv ("LCMAPS_LOG_FILE"), "a");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:192: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).
	llgt_logfile=fopen(llgt_logfilename, "a");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:237: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_ERRORBUF_LEN];
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:238: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	datetime[21];
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:262:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(&(buf[MAX_ERRORBUF_LEN-5]),"...\n");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:279:6:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	    sprintf(&(buf[MAX_ERRORBUF_LEN-5]),"...\n");
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:384:2:  [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(subject, peer_name_buffer.value, peer_name_buffer.length);
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:417: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         jr_id[71];
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:419: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         gatekeeper_jm_id[64];
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:363:10:  [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(local_identity) < buffer_length) {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:377:19:  [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).
			(long unsigned)strlen(local_identity), buffer_length));
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:430:9:  [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(local_identity) + 1 > buffer_length) {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:435:19:  [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).
		 (long unsigned)strlen(local_identity),
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_front.c:440: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).
		(long unsigned)strlen(local_identity),
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:185:24:  [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 (input==NULL || strlen(input)==0)
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:190:17:  [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).
    for (i=0; i<strlen(input); i++)	{
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_lcmaps.c:474:26:  [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 (desired_username && strlen(desired_username)>0)
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:113:13:  [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(syslog_log_prefix) == 0) {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:501:9:  [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(pem_buf) > INT_MAX)  {
data/lcas-lcmaps-gt4-interface-0.3.1/src/llgt_utils.c:510:32:  [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).
	 (BIO_write(bp, pem_buf, (int)strlen(pem_buf)))<=0 )	{

ANALYSIS SUMMARY:

Hits = 62
Lines analyzed = 2300 in approximately 0.18 seconds (12505 lines/second)
Physical Source Lines of Code (SLOC) = 1354
Hits@level = [0]  11 [1]  11 [2]  10 [3]  37 [4]   4 [5]   0
Hits@level+ = [0+]  73 [1+]  62 [2+]  51 [3+]  41 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 53.9143 [1+] 45.7903 [2+] 37.6662 [3+] 30.2806 [4+] 2.95421 [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.