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/dsh-0.25.10/dsh.c
Examining data/dsh-0.25.10/linkedlist.c
Examining data/dsh-0.25.10/parameter.c
Examining data/dsh-0.25.10/dsh.h
Examining data/dsh-0.25.10/linkedlist.h
Examining data/dsh-0.25.10/parameter.h
Examining data/dsh-0.25.10/gettext.h
Examining data/dsh-0.25.10/drshd.c

FINAL RESULTS:

data/dsh-0.25.10/dsh.c:101:5:  [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.
    vsnprintf(*strp, buflen, fmt, ap);
data/dsh-0.25.10/dsh.c:185:4:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	  fprintf(stderr, PACKAGE ": %s\n", _("Failed playing with pipe"));
data/dsh-0.25.10/linkedlist.c:155:3:  [4] (shell) execvp:
  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.
  execvp (command, av);  
data/dsh-0.25.10/dsh.c:645:43:  [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 (asprintf (&buf, "%s/.dsh/dsh.conf", getenv("HOME")) < 0)
data/dsh-0.25.10/parameter.c:422:9:  [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.
#define getopt_long(a,b,c,d,e) getopt(a,b,c)
data/dsh-0.25.10/parameter.c:422:32:  [3] (buffer) getopt:
  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.
#define getopt_long(a,b,c,d,e) getopt(a,b,c)
data/dsh-0.25.10/parameter.c:431:14:  [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 (ac, av, 
data/dsh-0.25.10/parameter.c:441:50:  [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 (asprintf(&buf, "%s/.dsh/machines.list", getenv("HOME"))<0)
data/dsh-0.25.10/parameter.c:469:43:  [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 (asprintf(&buf2, "%s/.dsh/group/%s", getenv("HOME"), optarg)<0)
data/dsh-0.25.10/parameter.c:167: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).
  if ((f = fopen (listfile, "r")) || ((NULL != alternatelistfile) && (f=fopen(alternatelistfile, "r"))))
data/dsh-0.25.10/parameter.c:167:73:  [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 ((f = fopen (listfile, "r")) || ((NULL != alternatelistfile) && (f=fopen(alternatelistfile, "r"))))
data/dsh-0.25.10/parameter.c:244: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).
  FILE*f = fopen (dsh_conf, "r");  
data/dsh-0.25.10/parameter.c:270:21:  [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).
	      wait_shell = atoi ( buf_b );		  
data/dsh-0.25.10/parameter.c:275:24:  [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).
	      pipe_option |= (atoi ( buf_b ) != 0 );
data/dsh-0.25.10/parameter.c:280:20:  [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).
	      forklimit = atoi ( buf_b );
data/dsh-0.25.10/parameter.c:289:23:  [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).
	      verbose_flag = atoi ( buf_b );
data/dsh-0.25.10/parameter.c:312:12:  [2] (misc) open:
  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).
  int in = open ("/dev/null", O_RDONLY);
data/dsh-0.25.10/parameter.c:485:16:  [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).
	  forklimit = atoi (optarg);
data/dsh-0.25.10/parameter.c:511:18:  [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).
	  buffer_size = atoi(optarg);	  
data/dsh-0.25.10/parameter.c:524:19:  [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).
	  num_topology = atoi (optarg);	  
data/dsh-0.25.10/dsh.c:83:8:  [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).
  *N = strlen (*LINEPTR);
data/dsh-0.25.10/dsh.c:94:25:  [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).
  ssize_t buflen = 50 * strlen(fmt); /* pick a number, any number */
data/dsh-0.25.10/dsh.c:509:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      while ((count = read(0, buf, buffer_size)) != -1 )
data/dsh-0.25.10/parameter.c:85: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).
  revpointer = pointer + strlen (pointer) - 1;

ANALYSIS SUMMARY:

Hits = 24
Lines analyzed = 1715 in approximately 0.09 seconds (20090 lines/second)
Physical Source Lines of Code (SLOC) = 1102
Hits@level = [0]  70 [1]   4 [2]  11 [3]   6 [4]   3 [5]   0
Hits@level+ = [0+]  94 [1+]  24 [2+]  20 [3+]   9 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 85.2995 [1+] 21.7786 [2+] 18.1488 [3+] 8.16697 [4+] 2.72232 [5+]   0
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.