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/littler-0.3.12/src/littler.c
Examining data/littler-0.3.12/src/config-const.h

FINAL RESULTS:

data/littler-0.3.12/src/littler.c:62:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(cp, "%s=%s", name, value);
data/littler-0.3.12/src/littler.c:58: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.
    if (clobber == 0 && getenv(name) != 0)
data/littler-0.3.12/src/littler.c:340: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.
    tmp = getenv("TMPDIR");		/* set tmp to TMPDIR, or TMP, or TEMP, or "/tmp" */
data/littler-0.3.12/src/littler.c:342:15:  [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.
        tmp = getenv("TMP");
data/littler-0.3.12/src/littler.c:344: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.
            tmp = getenv("TEMP");
data/littler-0.3.12/src/littler.c:470:5:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    srand(seed);
data/littler-0.3.12/src/littler.c:502:17:  [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.
    while ((c = getopt_long(argc, argv, "+hVve:npl:L:tqid", optargs, &optpos)) != -1) {
data/littler-0.3.12/src/littler.c:654:61:  [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.
        snprintf(rprofilesite, 110, "%s/etc/Rprofile.site", getenv("R_HOME"));
data/littler-0.3.12/src/littler.c:664:52:  [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.
        snprintf(dotrprofile, 110, "%s/.Rprofile", getenv("HOME"));
data/littler-0.3.12/src/littler.c:683:52:  [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.
        snprintf(dotlittler, 110, "%s/.littler.r", getenv("HOME"));
data/littler-0.3.12/src/littler.c:239:5:  [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(mb->buf+mb->count,buf,buflen);
data/littler-0.3.12/src/littler.c:394: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 txt[64];
data/littler-0.3.12/src/littler.c:653: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 rprofilesite[128];
data/littler-0.3.12/src/littler.c:655:19:  [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).
        if ((fp = fopen(rprofilesite, "r")) != 0) {
data/littler-0.3.12/src/littler.c:663: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 dotrprofile[128];
data/littler-0.3.12/src/littler.c:665:19:  [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).
        if ((fp = fopen(dotrprofile, "r")) != 0) {
data/littler-0.3.12/src/littler.c:674:19:  [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).
        if ((fp = fopen(etclittler, "r")) != 0) {
data/littler-0.3.12/src/littler.c:682: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 dotlittler[128];			/* load ~/.litter.r if it exists */
data/littler-0.3.12/src/littler.c:684:19:  [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).
        if ((fp = fopen(dotlittler, "r")) != 0) {
data/littler-0.3.12/src/littler.c:694: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 buf[128];
data/littler-0.3.12/src/littler.c:703: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 buf[128];
data/littler-0.3.12/src/littler.c:60:22:  [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 ((cp = malloc(strlen(name) + strlen(value) + 2)) == 0)
data/littler-0.3.12/src/littler.c:60:37:  [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 ((cp = malloc(strlen(name) + strlen(value) + 2)) == 0)
data/littler-0.3.12/src/littler.c:233: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).
    int buflen = strlen(buf);
data/littler-0.3.12/src/littler.c:406: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(R_STATUS)==0) {
data/littler-0.3.12/src/littler.c:696:34:  [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).
        snprintf(buf, 127 - 12 - strlen(libpathstr), ".libPaths(\"%s\");", libpathstr);
data/littler-0.3.12/src/littler.c:711: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).
                snprintf(buf, 127 - 27 - strlen(token), "suppressMessages(library(%s));", token);

ANALYSIS SUMMARY:

Hits = 27
Lines analyzed = 754 in approximately 0.05 seconds (16599 lines/second)
Physical Source Lines of Code (SLOC) = 571
Hits@level = [0]  36 [1]   6 [2]  11 [3]   9 [4]   1 [5]   0
Hits@level+ = [0+]  63 [1+]  27 [2+]  21 [3+]  10 [4+]   1 [5+]   0
Hits/KSLOC@level+ = [0+] 110.333 [1+] 47.2855 [2+] 36.7776 [3+] 17.5131 [4+] 1.75131 [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.