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/bwm-ng-0.6.2/src/bwm-ng.c
Examining data/bwm-ng-0.6.2/src/bwm-ng.h
Examining data/bwm-ng-0.6.2/src/curses_tools.c
Examining data/bwm-ng-0.6.2/src/curses_tools.h
Examining data/bwm-ng-0.6.2/src/defines.h
Examining data/bwm-ng-0.6.2/src/global_vars.h
Examining data/bwm-ng-0.6.2/src/help.c
Examining data/bwm-ng-0.6.2/src/help.h
Examining data/bwm-ng-0.6.2/src/input/devstat.c
Examining data/bwm-ng-0.6.2/src/input/devstat.h
Examining data/bwm-ng-0.6.2/src/input/getifaddrs.c
Examining data/bwm-ng-0.6.2/src/input/getifaddrs.h
Examining data/bwm-ng-0.6.2/src/input/ioservice.c
Examining data/bwm-ng-0.6.2/src/input/ioservice.h
Examining data/bwm-ng-0.6.2/src/input/libkstat.c
Examining data/bwm-ng-0.6.2/src/input/libkstat.h
Examining data/bwm-ng-0.6.2/src/input/libstatgrab.c
Examining data/bwm-ng-0.6.2/src/input/libstatgrab.h
Examining data/bwm-ng-0.6.2/src/input/netstat.c
Examining data/bwm-ng-0.6.2/src/input/netstat.h
Examining data/bwm-ng-0.6.2/src/input/proc_diskstats.c
Examining data/bwm-ng-0.6.2/src/input/proc_diskstats.h
Examining data/bwm-ng-0.6.2/src/input/proc_net_dev.c
Examining data/bwm-ng-0.6.2/src/input/proc_net_dev.h
Examining data/bwm-ng-0.6.2/src/input/retrieve.c
Examining data/bwm-ng-0.6.2/src/input/retrieve.h
Examining data/bwm-ng-0.6.2/src/input/sysctl.c
Examining data/bwm-ng-0.6.2/src/input/sysctl.h
Examining data/bwm-ng-0.6.2/src/input/win32.c
Examining data/bwm-ng-0.6.2/src/input/win32.h
Examining data/bwm-ng-0.6.2/src/options.c
Examining data/bwm-ng-0.6.2/src/options.h
Examining data/bwm-ng-0.6.2/src/output.c
Examining data/bwm-ng-0.6.2/src/output.h
Examining data/bwm-ng-0.6.2/src/process.c
Examining data/bwm-ng-0.6.2/src/process.h
Examining data/bwm-ng-0.6.2/src/types.h

FINAL RESULTS:

data/bwm-ng-0.6.2/src/bwm-ng.c:84:3:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		vprintf(error_msg,ap);
data/bwm-ng-0.6.2/src/bwm-ng.c:88:5:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vprintf(ap);
data/bwm-ng-0.6.2/src/input/netstat.c:70: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.
	if (!(f=(FILE *)popen(
data/bwm-ng-0.6.2/src/input/netstat.c:93:14:  [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.
    if (!(f2=popen( NETSTAT_PATH " -i","r")))
data/bwm-ng-0.6.2/src/input/netstat.c:115:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
        sscanf(buffer,"%s%*i%*i%llu%llu%*i%*i%llu%llu",name,&tmp_if_stats.packets.in,&tmp_if_stats.errors.in,&tmp_if_stats.packets.out,&tmp_if_stats.errors.out);
data/bwm-ng-0.6.2/src/input/netstat.c:119:7:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    		sscanf(buffer,"%s%*i%*s%*s%llu%llu%llu%llu%llu%llu",name,&tmp_if_stats.packets.in,&tmp_if_stats.errors.in,&tmp_if_stats.bytes.in,&tmp_if_stats.packets.out,&tmp_if_stats.errors.out,&tmp_if_stats.bytes.out);
data/bwm-ng-0.6.2/src/input/netstat.c:121:13:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
            sscanf(buffer,"%s%*i%*s%llu%llu%llu%llu%llu%llu",name,&tmp_if_stats.packets.in,&tmp_if_stats.errors.in,&tmp_if_stats.bytes.in,&tmp_if_stats.packets.out,&tmp_if_stats.errors.out,&tmp_if_stats.bytes.out);
data/bwm-ng-0.6.2/src/input/netstat.c:125:7:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
		    sscanf(buffer,"%s%*i%*s%*s%llu%llu%llu%llu",name,&tmp_if_stats.packets.in,&tmp_if_stats.errors.in,&tmp_if_stats.packets.out,&tmp_if_stats.errors.out);
data/bwm-ng-0.6.2/src/input/netstat.c:127:13:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
            sscanf(buffer,"%s%*i%*s%llu%llu%llu%llu",name,&tmp_if_stats.packets.in,&tmp_if_stats.errors.in,&tmp_if_stats.packets.out,&tmp_if_stats.errors.out);
data/bwm-ng-0.6.2/src/input/netstat.c:132:27:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
            if (test_buf) sscanf(buffer2,"%s%s%s%s%llu%llu%llu%llu",str_buf,str_buf,str_buf,str_buf,&tmp_if_stats.packets.in,&tmp_if_stats.errors.in,&tmp_if_stats.packets.out,&tmp_if_stats.errors.out);
data/bwm-ng-0.6.2/src/input/netstat.c:133:13:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
            sscanf(buffer,"%s%s%s%s%llu%llu",name,str_buf,str_buf,str_buf,&tmp_if_stats.bytes.in,&tmp_if_stats.bytes.out);
data/bwm-ng-0.6.2/src/input/netstat.c:135:27:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
            if (test_buf) sscanf(buffer2,"%s%s%s%llu%llu%llu%llu",str_buf,str_buf,str_buf,&tmp_if_stats.packets.in,&tmp_if_stats.errors.in,&tmp_if_stats.packets.out,&tmp_if_stats.errors.out);
data/bwm-ng-0.6.2/src/input/netstat.c:136:13:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
            sscanf(buffer,"%s%s%s%llu%llu",name,str_buf,str_buf,&tmp_if_stats.bytes.in,&tmp_if_stats.bytes.out);
data/bwm-ng-0.6.2/src/input/proc_diskstats.c:50: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(devicename,short_devicename);
data/bwm-ng-0.6.2/src/input/proc_diskstats.c:101:11:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function. If the scanf format is influenceable by an
  attacker, it's exploitable.
      n = sscanf(buffer,
data/bwm-ng-0.6.2/src/input/proc_diskstats.c:121:7:  [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(proc_stat,PROC_PARTITIONS_FILE);
data/bwm-ng-0.6.2/src/input/proc_net_dev.c:59:9:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
        sscanf(buffer,"%s",name);
data/bwm-ng-0.6.2/src/options.c:195:48:  [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).
        if (value && (strlen(value)<PATH_MAX)) strcpy(PROC_FILE,value);
data/bwm-ng-0.6.2/src/options.c:199:48:  [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).
        if (value && (strlen(value)<PATH_MAX)) strcpy(PROC_DISKSTATS_FILE,value);		  
data/bwm-ng-0.6.2/src/options.c:201:48:  [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).
        if (value && (strlen(value)<PATH_MAX)) strcpy(PROC_PARTITIONS_FILE,value);		  
data/bwm-ng-0.6.2/src/options.c:206:48:  [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).
        if (value && (strlen(value)<PATH_MAX)) strcpy(NETSTAT_FILE,value);
data/bwm-ng-0.6.2/src/options.c:382:6:  [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(PROC_DISKSTATS_FILE,optarg);
data/bwm-ng-0.6.2/src/options.c:386:16:  [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(PROC_PARTITIONS_FILE,optarg);
data/bwm-ng-0.6.2/src/options.c:429:58:  [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).
                if (optarg && (strlen(optarg)<PATH_MAX)) strcpy(PROC_FILE,optarg);
data/bwm-ng-0.6.2/src/options.c:472:58:  [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).
                if (optarg && (strlen(optarg)<PATH_MAX)) strcpy(NETSTAT_FILE,optarg);
data/bwm-ng-0.6.2/src/output.c:248:43:  [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.
            if (output_method==PLAIN_OUT) printf(ansi_output ? "\033[2;2H" : "\n");
data/bwm-ng-0.6.2/src/options.c:325:11:  [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.
        o=getopt_long (argc,argv,SHORT_OPTIONS,long_options, &option_index);
data/bwm-ng-0.6.2/src/options.c:327:11:  [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.
        o=getopt (argc,argv,SHORT_OPTIONS);
data/bwm-ng-0.6.2/src/options.c:352:5:  [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.
		o=getopt_long (argc,argv,SHORT_OPTIONS,long_options, &option_index);
data/bwm-ng-0.6.2/src/options.c:354:5:  [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.
		o=getopt (argc,argv,SHORT_OPTIONS);
data/bwm-ng-0.6.2/src/bwm-ng.c:253: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).
            out_file=fopen(out_file_path,"w");
data/bwm-ng-0.6.2/src/global_vars.h:35:8:  [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.
EXTERN char PROC_FILE[PATH_MAX];
data/bwm-ng-0.6.2/src/global_vars.h:38:8:  [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.
EXTERN char PROC_DISKSTATS_FILE[PATH_MAX];
data/bwm-ng-0.6.2/src/global_vars.h:39:8:  [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.
EXTERN char PROC_PARTITIONS_FILE[PATH_MAX];
data/bwm-ng-0.6.2/src/global_vars.h:42:8:  [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.
EXTERN char NETSTAT_FILE[PATH_MAX];
data/bwm-ng-0.6.2/src/global_vars.h:98:8:  [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.
EXTERN char start_time[30];
data/bwm-ng-0.6.2/src/input/ioservice.c:39:2:  [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 deviceFilePath[MAXPATHLEN]; //MAXPATHLEN is defined in sys/param.h
data/bwm-ng-0.6.2/src/input/proc_diskstats.c:64: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.
	static char proc_stat[PATH_MAX] = "";
data/bwm-ng-0.6.2/src/input/proc_diskstats.c:72: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).
	if (diskstats_works && !(f=fopen(PROC_DISKSTATS_FILE,"r"))) {
data/bwm-ng-0.6.2/src/input/proc_diskstats.c:85:11:  [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(PROC_PARTITIONS_FILE,"r"))) {
data/bwm-ng-0.6.2/src/input/proc_diskstats.c:124:8:  [2] (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). Risk is low because the source is a constant string.
							strcpy(ptr,"stat");
data/bwm-ng-0.6.2/src/input/proc_diskstats.c:131:16:  [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_s=fopen(proc_stat,"r"))) {
data/bwm-ng-0.6.2/src/input/proc_net_dev.c:40:10:  [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(PROC_FILE,"r"))) {
data/bwm-ng-0.6.2/src/input/win32.c:31:2:  [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 name[MAX_INTERFACE_NAME_LEN];
data/bwm-ng-0.6.2/src/options.c:178:13:  [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( config_file, "r" ) ) == NULL ) {
data/bwm-ng-0.6.2/src/options.c:192:22:  [2] (integer) atol:
  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).
        if (value && atol(value)>0) { delay=atol(value); }
data/bwm-ng-0.6.2/src/options.c:192:45:  [2] (integer) atol:
  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).
        if (value && atol(value)>0) { delay=atol(value); }
data/bwm-ng-0.6.2/src/options.c:221:31:  [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).
        if (value) avg_length=atoi(value)*1000;
data/bwm-ng-0.6.2/src/options.c:237: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).
            out_file=fopen(value,"a"); 
data/bwm-ng-0.6.2/src/options.c:244:33:  [2] (integer) atol:
  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).
        if (value) output_count=atol(value);
data/bwm-ng-0.6.2/src/options.c:255:22:  [2] (integer) atol:
  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).
        if (value && atol(value)>0) { html_refresh=atol(value); }
data/bwm-ng-0.6.2/src/options.c:255:52:  [2] (integer) atol:
  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).
        if (value && atol(value)>0) { html_refresh=atol(value); }
data/bwm-ng-0.6.2/src/options.c:395:27:  [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).
				if (optarg) daemonize=atoi(optarg);
data/bwm-ng-0.6.2/src/options.c:399:21:  [2] (integer) atol:
  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).
				if ((optarg) && atol(optarg)>0) { html_refresh=atol(optarg); }
data/bwm-ng-0.6.2/src/options.c:399:52:  [2] (integer) atol:
  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).
				if ((optarg) && atol(optarg)>0) { html_refresh=atol(optarg); }
data/bwm-ng-0.6.2/src/options.c:402:29:  [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).
				if (optarg) html_header=atoi(optarg);
data/bwm-ng-0.6.2/src/options.c:406:30:  [2] (integer) atol:
  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).
				if (optarg) output_count=atol(optarg);
data/bwm-ng-0.6.2/src/options.c:412:30:  [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).
                    out_file=fopen(optarg,"a"); 
data/bwm-ng-0.6.2/src/options.c:441:39:  [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).
                if (optarg) sumhidden=atoi(optarg);
data/bwm-ng-0.6.2/src/options.c:451:41:  [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).
                if (optarg) show_all_if=atoi(optarg);
data/bwm-ng-0.6.2/src/options.c:454:33:  [2] (integer) atol:
  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).
                if ((optarg) && atol(optarg)>0) { delay=atol(optarg); }
data/bwm-ng-0.6.2/src/options.c:454:57:  [2] (integer) atol:
  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).
                if ((optarg) && atol(optarg)>0) { delay=atol(optarg); }
data/bwm-ng-0.6.2/src/options.c:461:40:  [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).
                if (optarg) avg_length=atoi(optarg)*1000;
data/bwm-ng-0.6.2/src/options.c:465:37:  [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).
                if (optarg) dynamic=atoi(optarg);
data/bwm-ng-0.6.2/src/output.c:39:12:  [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.
    static char str[25];
data/bwm-ng-0.6.2/src/output.c:332: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 speed[3];
data/bwm-ng-0.6.2/src/output.c:423:4:  [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 buffer[50];
data/bwm-ng-0.6.2/src/process.c:231:4:  [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(&new_if_stats[new_if_count-1],&if_stats[local_if_count],(size_t)sizeof(t_iface_stats));
data/bwm-ng-0.6.2/src/bwm-ng.c:165:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy(PROC_FILE,PROC_NET_DEV,PATH_MAX);
data/bwm-ng-0.6.2/src/bwm-ng.c:169:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy(PROC_DISKSTATS_FILE,PROC_DISKSTATS,PATH_MAX);
data/bwm-ng-0.6.2/src/bwm-ng.c:172:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy(PROC_PARTITIONS_FILE,PROC_PARTITIONS,PATH_MAX);
data/bwm-ng-0.6.2/src/bwm-ng.c:220:7:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
		if (usleep(delay*1000) != 0) {
data/bwm-ng-0.6.2/src/bwm-ng.c:224:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
				usleep(999999);
data/bwm-ng-0.6.2/src/bwm-ng.c:294:8:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			if (usleep(delay*1000)==EINVAL) {
data/bwm-ng-0.6.2/src/bwm-ng.c:295:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
				usleep(999999);
data/bwm-ng-0.6.2/src/defines.h:333:27:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
#define strlcpy(_a,_b,_c) strncpy((_a),(_b),(_c)); (_a)[(_c) - 1]='\0';
data/bwm-ng-0.6.2/src/input/libkstat.c:50:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(name,ksp->ks_name,KSTAT_STRLEN);
data/bwm-ng-0.6.2/src/input/netstat.c:147: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).
		(name[strlen(name)-1]!='*')
data/bwm-ng-0.6.2/src/input/proc_diskstats.c:39:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(short_devicename,devicename,(int)(ptr-devicename));
data/bwm-ng-0.6.2/src/input/proc_diskstats.c:43:4:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
			strncat(short_devicename,&ptr[0],1);
data/bwm-ng-0.6.2/src/input/proc_diskstats.c:46:5:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
				strncat(short_devicename,&ptr[0],1);
data/bwm-ng-0.6.2/src/input/retrieve.c:38:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(ifr.ifr_name, ifname,sizeof(ifr.ifr_name));
data/bwm-ng-0.6.2/src/input/sysctl.c:78:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(name,saddr->sdl_data,saddr->sdl_nlen);
data/bwm-ng-0.6.2/src/input/win32.c:59:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(name,(char*)(if_table->table[i].bDescr),MAX_INTERFACE_NAME_LEN);	
data/bwm-ng-0.6.2/src/options.c:163: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).
   i = strlen(dud) - 1;
data/bwm-ng-0.6.2/src/options.c:195: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).
        if (value && (strlen(value)<PATH_MAX)) strcpy(PROC_FILE,value);
data/bwm-ng-0.6.2/src/options.c:199: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).
        if (value && (strlen(value)<PATH_MAX)) strcpy(PROC_DISKSTATS_FILE,value);		  
data/bwm-ng-0.6.2/src/options.c:201: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).
        if (value && (strlen(value)<PATH_MAX)) strcpy(PROC_PARTITIONS_FILE,value);		  
data/bwm-ng-0.6.2/src/options.c:206: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).
        if (value && (strlen(value)<PATH_MAX)) strcpy(NETSTAT_FILE,value);
data/bwm-ng-0.6.2/src/options.c:339:31:  [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).
            str=(char*)malloc(strlen(pwd_entry->pw_dir)+14);
data/bwm-ng-0.6.2/src/options.c:340: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).
            snprintf(str,strlen(pwd_entry->pw_dir)+14,"%s/.bwm-ng.conf",pwd_entry->pw_dir);
data/bwm-ng-0.6.2/src/options.c:381: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(optarg)<PATH_MAX) 
data/bwm-ng-0.6.2/src/options.c:385: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).
            if (strlen(optarg)<PATH_MAX)
data/bwm-ng-0.6.2/src/options.c:429: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).
                if (optarg && (strlen(optarg)<PATH_MAX)) strcpy(PROC_FILE,optarg);
data/bwm-ng-0.6.2/src/options.c:472: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).
                if (optarg && (strlen(optarg)<PATH_MAX)) strcpy(NETSTAT_FILE,optarg);
data/bwm-ng-0.6.2/src/process.c:55:6:  [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).
	k = strlen( searchstr );
data/bwm-ng-0.6.2/src/process.c:56:11:  [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<=strlen(instr);i++) {

ANALYSIS SUMMARY:

Hits = 97
Lines analyzed = 4671 in approximately 0.17 seconds (27173 lines/second)
Physical Source Lines of Code (SLOC) = 3244
Hits@level = [0]  82 [1]  29 [2]  38 [3]   4 [4]  26 [5]   0
Hits@level+ = [0+] 179 [1+]  97 [2+]  68 [3+]  30 [4+]  26 [5+]   0
Hits/KSLOC@level+ = [0+] 55.1788 [1+] 29.9014 [2+] 20.9618 [3+] 9.24784 [4+] 8.0148 [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.