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/lm-sensors-3.6.0/lib/access.c Examining data/lm-sensors-3.6.0/lib/conf.h Examining data/lm-sensors-3.6.0/lib/data.c Examining data/lm-sensors-3.6.0/lib/data.h Examining data/lm-sensors-3.6.0/lib/error.c Examining data/lm-sensors-3.6.0/lib/error.h Examining data/lm-sensors-3.6.0/lib/general.c Examining data/lm-sensors-3.6.0/lib/general.h Examining data/lm-sensors-3.6.0/lib/init.c Examining data/lm-sensors-3.6.0/lib/init.h Examining data/lm-sensors-3.6.0/lib/scanner.h Examining data/lm-sensors-3.6.0/lib/sensors.h Examining data/lm-sensors-3.6.0/lib/sysfs.c Examining data/lm-sensors-3.6.0/lib/sysfs.h Examining data/lm-sensors-3.6.0/lib/test/test-scanner.c Examining data/lm-sensors-3.6.0/lib/access.h Examining data/lm-sensors-3.6.0/prog/dump/isadump.c Examining data/lm-sensors-3.6.0/prog/dump/isaset.c Examining data/lm-sensors-3.6.0/prog/dump/superio.c Examining data/lm-sensors-3.6.0/prog/dump/superio.h Examining data/lm-sensors-3.6.0/prog/dump/util.c Examining data/lm-sensors-3.6.0/prog/dump/util.h Examining data/lm-sensors-3.6.0/prog/sensord/args.c Examining data/lm-sensors-3.6.0/prog/sensord/args.h Examining data/lm-sensors-3.6.0/prog/sensord/chips.c Examining data/lm-sensors-3.6.0/prog/sensord/lib.c Examining data/lm-sensors-3.6.0/prog/sensord/rrd.c Examining data/lm-sensors-3.6.0/prog/sensord/sense.c Examining data/lm-sensors-3.6.0/prog/sensord/sensord.c Examining data/lm-sensors-3.6.0/prog/sensord/sensord.h Examining data/lm-sensors-3.6.0/prog/sensors/chips.c Examining data/lm-sensors-3.6.0/prog/sensors/chips.h Examining data/lm-sensors-3.6.0/prog/sensors/main.c Examining data/lm-sensors-3.6.0/prog/sensors/main.h Examining data/lm-sensors-3.6.0/version.h FINAL RESULTS: data/lm-sensors-3.6.0/lib/sysfs.c:720:13: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. sub_len = readlink(linkpath, subsys_path, NAME_MAX - 1); data/lm-sensors-3.6.0/lib/sysfs.c:724:14: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. sub_len = readlink(linkpath, subsys_path, NAME_MAX - 1); data/lm-sensors-3.6.0/lib/sysfs.c:360:16: [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. if ((count = sscanf(name, matches[i].name, nr, &c))) data/lm-sensors-3.6.0/prog/sensord/chips.c:105:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buff, "Sound alarm %s", data/lm-sensors-3.6.0/prog/sensord/rrd.c:250:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(ptr, "DS:%s:GAUGE:%d:%s:%s", rawLabel, 5 * data/lm-sensors-3.6.0/prog/sensord/rrd.c:294:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(rraBuff, "RRA:%s:%f:%d:%d", data/lm-sensors-3.6.0/prog/sensord/sense.c:119:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(rrdBuff + strlen(rrdBuff), ":%s", data/lm-sensors-3.6.0/prog/sensord/sensord.c:53:2: [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(buffer, LOG_BUFFER, fmt, ap); data/lm-sensors-3.6.0/prog/sensors/chips.c:232:3: [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(fmt, limits[i].name, limits[i].value, data/lm-sensors-3.6.0/prog/sensors/main.c:147:2: [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(degstr, deg_default_text[fahrenheit]); data/lm-sensors-3.6.0/lib/sysfs.c:743:18: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. my_dev_path = realpath(linkpath, NULL); data/lm-sensors-3.6.0/lib/sysfs.c:841:13: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. dev_path = realpath(linkpath, NULL); data/lm-sensors-3.6.0/prog/sensord/args.c:151: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(argc, argv, shortOptions, longOptions, NULL)) data/lm-sensors-3.6.0/prog/sensors/main.c:295: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, "hsvfAc:uj", long_opts, NULL); data/lm-sensors-3.6.0/lib/access.c:171: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[PATH_MAX]; data/lm-sensors-3.6.0/lib/access.c:188: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(buf, "r"))) { data/lm-sensors-3.6.0/lib/general.c:65:2: [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(((char *) *my_list) + *num_el * el_size, el, el_size); data/lm-sensors-3.6.0/lib/general.c:83:2: [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(((char *)*my_list) + *num_el * el_size, els, el_size * nr_els); data/lm-sensors-3.6.0/lib/init.c:146:3: [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 path[PATH_MAX]; data/lm-sensors-3.6.0/lib/init.c:161: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). input = fopen(path, "r"); data/lm-sensors-3.6.0/lib/init.c:199: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). input = fopen(name = DEFAULT_CONFIG_FILE, "r"); data/lm-sensors-3.6.0/lib/init.c:201: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). input = fopen(name = ALT_CONFIG_FILE, "r"); data/lm-sensors-3.6.0/lib/sysfs.c:53: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 path[NAME_MAX]; data/lm-sensors-3.6.0/lib/sysfs.c:54: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[ATTR_MAX], *p; data/lm-sensors-3.6.0/lib/sysfs.c:59: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(path, "r"))) data/lm-sensors-3.6.0/lib/sysfs.c:81: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 path[NAME_MAX]; data/lm-sensors-3.6.0/lib/sysfs.c:113: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 path[NAME_MAX]; data/lm-sensors-3.6.0/lib/sysfs.c:139:1: [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 sensors_sysfs_mount[NAME_MAX]; data/lm-sensors-3.6.0/lib/sysfs.c:404: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 path[NAME_MAX]; data/lm-sensors-3.6.0/lib/sysfs.c:623: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 bus_path[NAME_MAX]; data/lm-sensors-3.6.0/lib/sysfs.c:707: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 linkpath[NAME_MAX]; data/lm-sensors-3.6.0/lib/sysfs.c:708: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 subsys_path[NAME_MAX], *subsys; data/lm-sensors-3.6.0/lib/sysfs.c:835: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 linkpath[NAME_MAX]; data/lm-sensors-3.6.0/lib/sysfs.c:921: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 n[NAME_MAX]; data/lm-sensors-3.6.0/lib/sysfs.c:925: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(n, "r"))) { data/lm-sensors-3.6.0/lib/sysfs.c:955: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 n[NAME_MAX]; data/lm-sensors-3.6.0/lib/sysfs.c:959: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(n, "w"))) { data/lm-sensors-3.6.0/prog/dump/isadump.c:103:11: [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. unsigned char enter_key[SUPERIO_MAX_KEY+1]; data/lm-sensors-3.6.0/prog/dump/util.c:18: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 s[2]; data/lm-sensors-3.6.0/prog/sensord/chips.c:34: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. static char buff[4096]; data/lm-sensors-3.6.0/prog/sensord/chips.c:39:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff + strlen(buff), " [ALARM]"); data/lm-sensors-3.6.0/prog/sensord/chips.c:41:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff + strlen(buff), " (beep)"); data/lm-sensors-3.6.0/prog/sensord/chips.c:47:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "%.1f C (limit = %.1f C, hysteresis = %.1f C)", data/lm-sensors-3.6.0/prog/sensord/chips.c:54:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "%.1f C (min = %.1f C, max = %.1f C)", values[0], data/lm-sensors-3.6.0/prog/sensord/chips.c:61:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "%.1f C", values[0]); data/lm-sensors-3.6.0/prog/sensord/chips.c:67:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "%+.2f V", values[0]); data/lm-sensors-3.6.0/prog/sensord/chips.c:73:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "%+.3f V", values[0]); data/lm-sensors-3.6.0/prog/sensord/chips.c:79:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "%+.2f V (min = %+.2f V, max = %+.2f V)", values[0], data/lm-sensors-3.6.0/prog/sensord/chips.c:86:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "%.0f RPM (min = %.0f RPM, div = %.0f)", values[0], data/lm-sensors-3.6.0/prog/sensord/chips.c:93:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "%.0f RPM (min = %.0f RPM)", values[0], values[1]); data/lm-sensors-3.6.0/prog/sensord/chips.c:99:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "%.0f RPM", values[0]); data/lm-sensors-3.6.0/prog/sensord/chips.c:112:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "%.0f", values[0]); data/lm-sensors-3.6.0/prog/sensord/chips.c:118:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "%.1f", values[0]); data/lm-sensors-3.6.0/prog/sensord/chips.c:124:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "%.2f", values[0]); data/lm-sensors-3.6.0/prog/sensord/chips.c:130:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buff, "%.3f", values[0]); data/lm-sensors-3.6.0/prog/sensord/lib.c:58:8: [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). fp = fopen(cfgPath, "r"); data/lm-sensors-3.6.0/prog/sensord/rrd.c:65:1: [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 rrdBuff[MAX_RRD_SENSORS * RRD_BUFF + 1]; data/lm-sensors-3.6.0/prog/sensord/rrd.c:66: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. static char rrdLabels[MAX_RRD_SENSORS][RAW_LABEL_LENGTH + 1]; data/lm-sensors-3.6.0/prog/sensord/rrd.c:269: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 stepBuff[STEP_BUFF], rraBuff[RRA_BUFF]; data/lm-sensors-3.6.0/prog/sensord/rrd.c:271: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. const char *argv[6 + MAX_RRD_SENSORS] = { data/lm-sensors-3.6.0/prog/sensord/rrd.c:293:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(stepBuff, "%d", sensord_args.rrdTime); data/lm-sensors-3.6.0/prog/sensord/rrd.c:436: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 (!(loadavg = fopen("/proc/loadavg", "r"))) { data/lm-sensors-3.6.0/prog/sensord/rrd.c:448:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(rrdBuff + strlen(rrdBuff), ":%f", data/lm-sensors-3.6.0/prog/sensord/sense.c:40: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 buffer[256]; data/lm-sensors-3.6.0/prog/sensord/sensord.c:50: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 buffer[1 + LOG_BUFFER]; data/lm-sensors-3.6.0/prog/sensord/sensord.c:193:15: [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 (!(file = fopen(sensord_args.pidFile, "w"))) { data/lm-sensors-3.6.0/prog/sensors/main.c:47:1: [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 degstr[5]; /* store the correct string to print degrees */ data/lm-sensors-3.6.0/prog/sensors/main.c:95:18: [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). config_file = fopen(config_file_name, "r"); data/lm-sensors-3.6.0/prog/sensors/main.c:123: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. const char *deg_default_text[2] = { " C", " F" }; data/lm-sensors-3.6.0/prog/sensors/main.c:129: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 deg_latin1_text[2][3] = { "\260C", "\260F" }; data/lm-sensors-3.6.0/prog/sensors/main.c:153: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 buf[BUF_SIZE]; data/lm-sensors-3.6.0/prog/sensors/main.h:25: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 degstr[5]; data/lm-sensors-3.6.0/lib/sysfs.c:67: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). p = strndup(buf, strlen(buf) - 1); data/lm-sensors-3.6.0/prog/dump/util.c:39:11: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = fgetc(stdin); data/lm-sensors-3.6.0/prog/sensord/args.c:144:35: [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). sensord_args.isDaemon = (argv[0][strlen (argv[0]) - 1] == 'd'); data/lm-sensors-3.6.0/prog/sensord/chips.c:39: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). sprintf(buff + strlen(buff), " [ALARM]"); data/lm-sensors-3.6.0/prog/sensord/chips.c:41: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). sprintf(buff + strlen(buff), " (beep)"); data/lm-sensors-3.6.0/prog/sensord/rrd.c:448: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). sprintf(rrdBuff + strlen(rrdBuff), ":%f", data/lm-sensors-3.6.0/prog/sensord/sense.c:119: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). sprintf(rrdBuff + strlen(rrdBuff), ":%s", data/lm-sensors-3.6.0/prog/sensord/sense.c:285:2: [1] (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 character. strcpy(rrdBuff, "N"); data/lm-sensors-3.6.0/prog/sensors/chips.c:136: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). int len = strlen(label)+1; data/lm-sensors-3.6.0/prog/sensors/chips.c:180: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). strlen(label) > max_size) data/lm-sensors-3.6.0/prog/sensors/chips.c:181:15: [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). max_size = strlen(label); data/lm-sensors-3.6.0/prog/sensors/chips.c:461:46: [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). printf("%6.2f %sV%*s", val, unit, 2 - (int)strlen(unit), ""); data/lm-sensors-3.6.0/prog/sensors/chips.c:658:46: [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). printf("%6.2f %sW%*s", val, unit, 2 - (int)strlen(unit), ""); data/lm-sensors-3.6.0/prog/sensors/chips.c:821:46: [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). printf("%6.2f %sA%*s", val, unit, 2 - (int)strlen(unit), ""); ANALYSIS SUMMARY: Hits = 86 Lines analyzed = 7366 in approximately 0.26 seconds (27882 lines/second) Physical Source Lines of Code (SLOC) = 5303 Hits@level = [0] 228 [1] 14 [2] 58 [3] 4 [4] 8 [5] 2 Hits@level+ = [0+] 314 [1+] 86 [2+] 72 [3+] 14 [4+] 10 [5+] 2 Hits/KSLOC@level+ = [0+] 59.2118 [1+] 16.2172 [2+] 13.5772 [3+] 2.64002 [4+] 1.88573 [5+] 0.377145 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.