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/cdargs-1.35/src/cdargs.h
Examining data/cdargs-1.35/src/cdargs.cc

FINAL RESULTS:

data/cdargs-1.35/src/cdargs.cc:918:5:  [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((string(editor) + " \"" + get_listfile() + "\"").c_str());
data/cdargs-1.35/src/cdargs.cc:1152:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(description_format, " [%%-%ds] %%c%%s", actual_maxlength );
data/cdargs-1.35/src/cdargs.cc:1250:18:  [4] (shell) popen:
  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.
    FILE* help = popen(pager,"w");
data/cdargs-1.35/src/cdargs.cc:130:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long (argc, argv, "a:f:u:brco:vh",
data/cdargs-1.35/src/cdargs.cc:520:23:  [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.
        list_from_dir(getenv("HOME"));
data/cdargs-1.35/src/cdargs.cc:907: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.
    char* editor = getenv("EDITOR");
data/cdargs-1.35/src/cdargs.cc:1009: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.
    return string(getenv("HOME")) + filename.substr(1);
data/cdargs-1.35/src/cdargs.cc:1235: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.
    char *pager = getenv("PAGER");
data/cdargs-1.35/src/cdargs.cc:220:28:  [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).
            CurrPosition = atoi(Needle);
data/cdargs-1.35/src/cdargs.cc:558: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 desc[DESCRIPTION_MAXLENGTH+1];
data/cdargs-1.35/src/cdargs.cc:1085: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 description_format[40];
data/cdargs-1.35/src/cdargs.cc:216:12:  [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(Needle) > 0) {
data/cdargs-1.35/src/cdargs.cc:219:12:  [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(Needle) == 1 && isdigit(Needle[0])) {
data/cdargs-1.35/src/cdargs.cc:1113: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).
            if ( strlen(li->first.c_str() ) > actual_maxlength ) {
data/cdargs-1.35/src/cdargs.cc:1114:36:  [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).
                actual_maxlength = strlen(li->first.c_str() );

ANALYSIS SUMMARY:

Hits = 15
Lines analyzed = 1499 in approximately 0.06 seconds (26265 lines/second)
Physical Source Lines of Code (SLOC) = 1185
Hits@level = [0]  46 [1]   4 [2]   3 [3]   5 [4]   3 [5]   0
Hits@level+ = [0+]  61 [1+]  15 [2+]  11 [3+]   8 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 51.4768 [1+] 12.6582 [2+] 9.2827 [3+] 6.75105 [4+] 2.53165 [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.