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/powerdebug-0.7.0-2013.08/powerdebug.h
Examining data/powerdebug-0.7.0-2013.08/regulator.c
Examining data/powerdebug-0.7.0-2013.08/sensor.h
Examining data/powerdebug-0.7.0-2013.08/clocks.c
Examining data/powerdebug-0.7.0-2013.08/tree.h
Examining data/powerdebug-0.7.0-2013.08/clocks.h
Examining data/powerdebug-0.7.0-2013.08/powerdebug.c
Examining data/powerdebug-0.7.0-2013.08/mainloop.c
Examining data/powerdebug-0.7.0-2013.08/gpio.c
Examining data/powerdebug-0.7.0-2013.08/utils.h
Examining data/powerdebug-0.7.0-2013.08/sensor.c
Examining data/powerdebug-0.7.0-2013.08/display.h
Examining data/powerdebug-0.7.0-2013.08/mainloop.h
Examining data/powerdebug-0.7.0-2013.08/utils.c
Examining data/powerdebug-0.7.0-2013.08/gpio.h
Examining data/powerdebug-0.7.0-2013.08/display.c
Examining data/powerdebug-0.7.0-2013.08/tree.c
Examining data/powerdebug-0.7.0-2013.08/regulator.h

FINAL RESULTS:

data/powerdebug-0.7.0-2013.08/clocks.c:427:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(clk_dir_path[CCF], "%s/clk", clk_dir_path[CCF]);
data/powerdebug-0.7.0-2013.08/clocks.c:428:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(clk_dir_path[OCF], "%s/clock", clk_dir_path[OCF]);
data/powerdebug-0.7.0-2013.08/clocks.c:429:7:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	if (!access(clk_dir_path[CCF], F_OK)) {
data/powerdebug-0.7.0-2013.08/clocks.c:431: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(clk_dir_path[MAX],clk_dir_path[CCF]);
data/powerdebug-0.7.0-2013.08/clocks.c:433:11:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	else if(!access(clk_dir_path[OCF], F_OK)) {
data/powerdebug-0.7.0-2013.08/clocks.c:435: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(clk_dir_path[MAX],clk_dir_path[OCF]);
data/powerdebug-0.7.0-2013.08/regulator.c:101:4:  [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.
			printf(regdata[i].ofmt, val);
data/powerdebug-0.7.0-2013.08/regulator.c:103:4:  [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.
			printf(regdata[i].ofmt, buffer);
data/powerdebug-0.7.0-2013.08/sensor.c:129:4:  [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(sensor->temperatures[nrtemps].name,
data/powerdebug-0.7.0-2013.08/sensor.c:148:4:  [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(sensor->fans[nrfans].name,
data/powerdebug-0.7.0-2013.08/sensor.c:216:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf, "%s", sensor->name);
data/powerdebug-0.7.0-2013.08/sensor.c:222:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buf, " %-35s%.1f", sensor->temperatures[i].name,
data/powerdebug-0.7.0-2013.08/sensor.c:229:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(buf, " %-35s%d rpm", sensor->fans[i].name,
data/powerdebug-0.7.0-2013.08/utils.c:49:15:  [4] (buffer) fscanf:
  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.
        ret = fscanf(file, format, value) == EOF ? -1 : 0;
data/powerdebug-0.7.0-2013.08/utils.c:85:8:  [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.
	ret = fprintf(file, format, value) < 0 ? -1 : 0;
data/powerdebug-0.7.0-2013.08/powerdebug.c:111:7:  [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, "rscgp:t:dvVh",
data/powerdebug-0.7.0-2013.08/clocks.c:61:2:  [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(clk_path, "/sys/kernel/debug");
data/powerdebug-0.7.0-2013.08/clocks.c:422: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 clk_dir_path[MAX+1][PATH_MAX];
data/powerdebug-0.7.0-2013.08/display.c:470: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 match[2] = { [0] = (char)keystroke, [1] = '\0' };
data/powerdebug-0.7.0-2013.08/gpio.c:42: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 direction[MAX_VALUE_BYTE];
data/powerdebug-0.7.0-2013.08/gpio.c:43: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 edge[MAX_VALUE_BYTE];
data/powerdebug-0.7.0-2013.08/gpio.c:282:4:  [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(gpio->direction, "out");
data/powerdebug-0.7.0-2013.08/gpio.c:284:4:  [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(gpio->direction, "in");
data/powerdebug-0.7.0-2013.08/powerdebug.c:143: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).
			options->ticktime = atoi(optarg);
data/powerdebug-0.7.0-2013.08/regulator.c:37: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[NAME_MAX];
data/powerdebug-0.7.0-2013.08/regulator.c:38: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 state[VALUE_MAX];
data/powerdebug-0.7.0-2013.08/regulator.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 status[VALUE_MAX];
data/powerdebug-0.7.0-2013.08/regulator.c:40: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 type[VALUE_MAX];
data/powerdebug-0.7.0-2013.08/regulator.c:41: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 opmode[VALUE_MAX];
data/powerdebug-0.7.0-2013.08/regulator.c:86: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 buffer[NAME_MAX];
data/powerdebug-0.7.0-2013.08/regulator.c:100:10:  [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).
			val = atoi(buffer);
data/powerdebug-0.7.0-2013.08/sensor.c:36: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[NAME_MAX];
data/powerdebug-0.7.0-2013.08/sensor.c:41: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[NAME_MAX];
data/powerdebug-0.7.0-2013.08/sensor.c:46: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[NAME_MAX];
data/powerdebug-0.7.0-2013.08/sensor.c:210: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 buf[1024];
data/powerdebug-0.7.0-2013.08/utils.c:43: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).
        file = fopen(rpath, "r");
data/powerdebug-0.7.0-2013.08/utils.c:79:9:  [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 = fopen(rpath, "w");
data/powerdebug-0.7.0-2013.08/display.c:94:19:  [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).
		curr_pointer += strlen(windata[i].name) + 2;
data/powerdebug-0.7.0-2013.08/display.c:115:42:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
static int display_refresh(int win, bool read)
data/powerdebug-0.7.0-2013.08/display.c:122:36:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		return windata[win].ops->display(read);
data/powerdebug-0.7.0-2013.08/display.c:488:7:  [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(string))
data/powerdebug-0.7.0-2013.08/display.c:489: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).
			string[strlen(string) - 1] = '\0';
data/powerdebug-0.7.0-2013.08/display.c:515:7:  [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(string) < findd->len - 1)
data/powerdebug-0.7.0-2013.08/display.c:516: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).
			string[strlen(string)] = (char)keystroke;
data/powerdebug-0.7.0-2013.08/display.c:533:39:  [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 (display_show_footer(current_win, strlen(string) ? string :
data/powerdebug-0.7.0-2013.08/regulator.c:89:41:  [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 (!strncmp("regulator.", tree->name, strlen("regulator.")))
data/powerdebug-0.7.0-2013.08/regulator.c:127:7:  [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(reg->name))
data/powerdebug-0.7.0-2013.08/sensor.c:58:7:  [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(sensor->name))
data/powerdebug-0.7.0-2013.08/sensor.c:213:7:  [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(sensor->name))
data/powerdebug-0.7.0-2013.08/tree.c:310:7:  [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(sf->name))
data/powerdebug-0.7.0-2013.08/tree.c:313: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).
	if (strncmp(sf->name, tree->name, strlen(sf->name)))

ANALYSIS SUMMARY:

Hits = 51
Lines analyzed = 3007 in approximately 0.08 seconds (37713 lines/second)
Physical Source Lines of Code (SLOC) = 1945
Hits@level = [0]  54 [1]  14 [2]  21 [3]   1 [4]  15 [5]   0
Hits@level+ = [0+] 105 [1+]  51 [2+]  37 [3+]  16 [4+]  15 [5+]   0
Hits/KSLOC@level+ = [0+] 53.9846 [1+] 26.2211 [2+] 19.0231 [3+] 8.22622 [4+] 7.71208 [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.