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/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c

FINAL RESULTS:

data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:344:25:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
                        system(cmd);
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:959:15:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
         rc = sprintf(state->path,"%s",state->log_file);
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:966:15:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
         rc = sprintf(state->path,"%s%s%d",state->log_file,".",state->file_number);
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:229: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("SEG_SGE_DEBUG") == NULL)
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:391: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.
                char * tmp = getenv("SGE_ROOT");
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:400: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.
                char * tmp = getenv("SGE_CELL");
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:334:22:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
                tf = tmpfile();
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:446:22:  [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).
	logfile_state->fp = fopen(logfile_state->path, "r");
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:585:29:  [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).
                state->fp = fopen(state->path,"r");
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:683:28:  [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).
               state->fp = fopen(state->path,"r");
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:1338: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).
    state->fp = fopen(state->path,"r");
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:356:42:  [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).
                                sge_root[strlen(sge_root)-1] = 0;
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:374:42:  [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).
                                sge_cell[strlen(sge_cell)-1] = 0;
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:785:23:  [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).
	state->path = malloc(strlen(state->log_file) + 10);
data/globus-gram-job-manager-sge-3.1/seg/seg_sge_module.c:1160: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(fields[0]) > 10)

ANALYSIS SUMMARY:

Hits = 15
Lines analyzed = 1503 in approximately 0.06 seconds (24933 lines/second)
Physical Source Lines of Code (SLOC) = 1032
Hits@level = [0]   9 [1]   4 [2]   5 [3]   3 [4]   3 [5]   0
Hits@level+ = [0+]  24 [1+]  15 [2+]  11 [3+]   6 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 23.2558 [1+] 14.5349 [2+] 10.6589 [3+] 5.81395 [4+] 2.90698 [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.