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/lilo-24.2/diagnose/bios.c Examining data/lilo-24.2/diagnose/cprintf.c Examining data/lilo-24.2/diagnose/test4.c Examining data/lilo-24.2/diagnose/test5.c Examining data/lilo-24.2/src/shs2.h Examining data/lilo-24.2/src/shs2.c Examining data/lilo-24.2/src/geometry.c Examining data/lilo-24.2/src/geometry.h Examining data/lilo-24.2/src/lilo.c Parsing failed to find end of parameter list; semicolon terminated it in ("%s\n", name #else /* !__MSDOS__ */ printf("%s%-" SA(MAX_IMAGE_NAME) "s %s%s%s",verbose > 0 ? " " : "",name, image ? "" : "*", #ifdef LCF_VIRTUAL descrs.d.descr[image].flags & FLA Examining data/lilo-24.2/src/lilo.h Examining data/lilo-24.2/src/partition.c Examining data/lilo-24.2/src/partition.h Examining data/lilo-24.2/src/probe.c Examining data/lilo-24.2/src/probe.h Examining data/lilo-24.2/src/common.c Examining data/lilo-24.2/src/version.h Examining data/lilo-24.2/src/loader.h Examining data/lilo-24.2/src/map.c Examining data/lilo-24.2/src/map.h Examining data/lilo-24.2/src/md-int.h Examining data/lilo-24.2/src/temp.c Examining data/lilo-24.2/src/boot.c Examining data/lilo-24.2/src/cfg.c Examining data/lilo-24.2/src/cfg.h Examining data/lilo-24.2/src/edit.c Examining data/lilo-24.2/src/device.h Examining data/lilo-24.2/src/edit.h Examining data/lilo-24.2/src/bdata.h Examining data/lilo-24.2/src/bitmap.h Examining data/lilo-24.2/src/boot.h Examining data/lilo-24.2/src/bsect.h Examining data/lilo-24.2/src/config.h Examining data/lilo-24.2/src/identify.h Examining data/lilo-24.2/src/temp.h Examining data/lilo-24.2/src/vesainfo.h Examining data/lilo-24.2/src/common.h Examining data/lilo-24.2/src/device.c Examining data/lilo-24.2/src/raid.h Examining data/lilo-24.2/src/bsect.c Examining data/lilo-24.2/src/identify.c Examining data/lilo-24.2/src/raid.c FINAL RESULTS: data/lilo-24.2/src/common.c:238: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. count = readlink(name, lname, sizeof(lname)-1); data/lilo-24.2/src/geometry.c:999:17: [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. if ((result = readlink(dmdev, buf, PATH_MAX)) < 0 && errno != EINVAL) data/lilo-24.2/diagnose/test4.c:18:9: [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. #define printf cprintf data/lilo-24.2/diagnose/test4.c:387:2: [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(s1); data/lilo-24.2/diagnose/test4.c:390:2: [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(s1); data/lilo-24.2/diagnose/test4.c:477:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:503:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:523:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:583:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:647:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:669:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:692:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:720:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:745:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:779:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:837:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:876:2: [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(SPACER data/lilo-24.2/diagnose/test4.c:926:6: [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(SPACER data/lilo-24.2/diagnose/test4.c:973:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:1004:2: [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(SPACER data/lilo-24.2/diagnose/test4.c:1105:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:1135:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:1159:5: [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(SPACER data/lilo-24.2/diagnose/test4.c:1246:5: [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(SPACER); data/lilo-24.2/diagnose/test5.c:19:9: [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. #define printf cprintf data/lilo-24.2/src/bsect.c:360:16: [4] (misc) getpass: This function is obsolete and not portable. It was in SUSv2 but removed by POSIX.2. What it does exactly varies considerably between systems, particularly in where its prompt is displayed and where it gets its data (e.g., /dev/tty, stdin, stderr, etc.). In addition, some implementations overflow buffers. (CWE-676, CWE-120, CWE-20). Make the specific calls to do exactly what you want. If you continue to use it, or write your own, be sure to zero the password as soon as possible to avoid leaving the cleartext password visible in the process' address space. char *cp = getpass(""); data/lilo-24.2/src/bsect.c:610:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(strcpy(temp_map,map_name),MAP_TMP_APP); data/lilo-24.2/src/bsect.c:610:9: [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). strcat(strcpy(temp_map,map_name),MAP_TMP_APP); data/lilo-24.2/src/bsect.c:613:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(strcat(strcpy(temp_map,map_name),MAP_TMP_APP),colon+1); data/lilo-24.2/src/bsect.c:613:9: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(strcat(strcpy(temp_map,map_name),MAP_TMP_APP),colon+1); data/lilo-24.2/src/bsect.c:613: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). strcat(strcat(strcpy(temp_map,map_name),MAP_TMP_APP),colon+1); data/lilo-24.2/src/bsect.c:669:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(strcpy(temp_map,map_name),MAP_TMP_APP); data/lilo-24.2/src/bsect.c:669:9: [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). strcat(strcpy(temp_map,map_name),MAP_TMP_APP); data/lilo-24.2/src/bsect.c:672:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(strcat(strcpy(temp_map,map_name),MAP_TMP_APP),colon+1); data/lilo-24.2/src/bsect.c:672:9: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(strcat(strcpy(temp_map,map_name),MAP_TMP_APP),colon+1); data/lilo-24.2/src/bsect.c:672: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). strcat(strcat(strcpy(temp_map,map_name),MAP_TMP_APP),colon+1); data/lilo-24.2/src/bsect.c:1028:5: [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(descrs.d.descr[this_image].name,label); data/lilo-24.2/src/bsect.c:1091:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(strchr(options,0),"root=%s ", root); data/lilo-24.2/src/bsect.c:1094:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(strchr(options,0),"root=%s ", root); data/lilo-24.2/src/bsect.c:1097:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(strchr(options,0),"root=%s ", root); data/lilo-24.2/src/bsect.c:1124:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(options, append); data/lilo-24.2/src/bsect.c:1132:10: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(strcat(options,append)," "); data/lilo-24.2/src/bsect.c:1141:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(options,append_local); data/lilo-24.2/src/bsect.c:1148:18: [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 (literal) strcpy(options,literal); data/lilo-24.2/src/bsect.c:1248: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(fallback_buf+2,fback); data/lilo-24.2/src/bsect.c:1553:10: [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(path,F_OK)) return 1; data/lilo-24.2/src/bsect.c:1568:10: [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(path,F_OK)) return 1; data/lilo-24.2/src/bsect.c:1635:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(temp_name,BACKUP_DIR "/boot.%04X",boot_dev_nr); data/lilo-24.2/src/cfg.c:267:30: [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. void __attribute__ ((format (printf, 1, 2))) cfg_error(char *msg,...) data/lilo-24.2/src/cfg.c:273:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(errstd,msg,ap); data/lilo-24.2/src/cfg.c:626:5: [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(name, file_name); /* copy name of config file '/etc/lilo.conf' */ data/lilo-24.2/src/cfg.c:627:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(name, PW_FILE_SUFFIX); data/lilo-24.2/src/cfg.h:40:55: [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. void cfg_error(char *msg,...) __attribute__ ((format (printf, 1, 2))); data/lilo-24.2/src/common.c:53: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. /*volatile*/ void __attribute__ ((format (printf, 1, 2))) die(const char *fmt,...) data/lilo-24.2/src/common.c:60:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(errstd,fmt,ap); data/lilo-24.2/src/common.c:77:5: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(errstd,fmt,ap); data/lilo-24.2/src/common.h:122:13: [4] (shell) system: 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. ;*/ char system[8]; /* system ID data/lilo-24.2/src/common.h:404: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. /*volatile*/ void __attribute__ ((format (printf, 1, 2))) data/lilo-24.2/src/device.c:97:8: [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(start+1,dir->d_name); data/lilo-24.2/src/device.c:139: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(name,(*walk)->name); data/lilo-24.2/src/device.c:151: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(name,(*walk)->name); data/lilo-24.2/src/device.c:207:34: [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). dev->delete = !scan_dir(&st,dev,strcpy(name,DEV_DIR),number); data/lilo-24.2/src/device.c:212: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(name,getenv("TMPDIR")); data/lilo-24.2/src/device.c:213:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(name+strlen(name),TMP_DEV+4,count); data/lilo-24.2/src/device.c:217:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(name,TMP_DEV,count); data/lilo-24.2/src/device.c:278:13: [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). strcat(strcpy(format,tem),"disc"); data/lilo-24.2/src/device.c:280:13: [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). strcat(strcpy(format,tem),"part%d"); data/lilo-24.2/src/device.c:285: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(format, name); data/lilo-24.2/src/device.c:291:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(tem, format, j); data/lilo-24.2/src/device.c:313:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(tem2, DEV_DIR "/ide/host%d/bus%d/target%d/lun0/", host, bus, target); data/lilo-24.2/src/device.c:314:9: [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). strcat(strcpy(format,tem2), "part%d"); data/lilo-24.2/src/device.c:318: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). strcat(strcpy(format, name), "%d"); data/lilo-24.2/src/device.c:323:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(tem, format, i); data/lilo-24.2/src/device.c:367:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(tmp, is_devfs() ? DEV_DISK_DIR "/md/%d" : DEV_DISK_DIR "/md%d", i); data/lilo-24.2/src/device.c:379:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(tmp, is_devfs() ? DEV_DIR "/loop/%d" : DEV_DIR "/loop%d", i); data/lilo-24.2/src/device.c:442:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(temp_name, "%s/%s.%04X", backup_file, filename, device); data/lilo-24.2/src/device.c:456: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). backup_file = strcpy(temp_name, backup_file); data/lilo-24.2/src/device.c:464: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(name+1,suffix); data/lilo-24.2/src/device.c:466:27: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). else if (name[1]==0) strcat(name,suffix); /* ended with '.' */ data/lilo-24.2/src/device.c:469:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(backup_file,suffix); data/lilo-24.2/src/device.c:476:6: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(backup_file,suffix); data/lilo-24.2/src/device.c:481:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(temp_name, BACKUP_DIR "/%s.%04X", filename, device); data/lilo-24.2/src/edit.c:228:5: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(datfile, BMP_CONF); data/lilo-24.2/src/edit.c:278:17: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). temp_file = strcat(strcpy(alloc(strlen(bitmap_file)+strlen(MAP_TMP_APP)+1), data/lilo-24.2/src/edit.c:278:24: [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). temp_file = strcat(strcpy(alloc(strlen(bitmap_file)+strlen(MAP_TMP_APP)+1), data/lilo-24.2/src/edit.c:675:20: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). bitmap_file = strcat(strcpy(alloc(strlen(config_file) + strlen(bitmap_file) + 1), data/lilo-24.2/src/edit.c:675:27: [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). bitmap_file = strcat(strcpy(alloc(strlen(config_file) + strlen(bitmap_file) + 1), data/lilo-24.2/src/edit.c:685: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(bitmap_file, config_file); data/lilo-24.2/src/edit.c:686:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(bitmap_file, BMP_BMP); data/lilo-24.2/src/geometry.c:483:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name,"%s/%s",parent,dir->d_name); data/lilo-24.2/src/geometry.c:1061: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. if (sscanf(params, "%02x:%02x %"PRIu64, &major, &minor, &target->offset) != 3) data/lilo-24.2/src/geometry.c:1065: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. if (sscanf(params, "%u:%u %"PRIu64, &major, &minor, &target->offset) != 3) data/lilo-24.2/src/geometry.c:1075:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, DEV_DIR "/%s", params); /* let's hope it's there */ data/lilo-24.2/src/geometry.c:1083:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buf, "/sys/block/%s/dev", params); data/lilo-24.2/src/geometry.c:1098: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. if (sscanf(p+1, "%"PRIu64, &target->offset) != 1) data/lilo-24.2/src/geometry.c:1179:2: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(mdxxx, DEV_DISK_DIR "/md%d", MINOR(device)); data/lilo-24.2/src/geometry.c:1182:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(mdxxx, DEV_DIR "/md/%d", MINOR(device)); data/lilo-24.2/src/lilo.c:732:4: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(reboot_arg, param); data/lilo-24.2/src/lilo.h:481:28: [4] (shell) system: 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. SYSSEG = DEF_SYSSEG ! system loaded at 0x10000 (65536). data/lilo-24.2/src/partition.c:101:41: [4] (shell) system: 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. else if ( !strncmp("NTFS", bs.par_d.system, 4) data/lilo-24.2/src/partition.c:267:6: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(backup_file,BACKUP_DIR "/part.%04X",dev_nr & ~mask); data/lilo-24.2/src/probe.c:252:2: [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( f==1 ? "Only 'root' may do this.\n\n" : data/lilo-24.2/src/cfg.c:339:17: [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 (!(var = getenv(buffer))) cfg_error("unknown variable \"%s\"",buffer); data/lilo-24.2/src/device.c:211:38: [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 (!strncmp(TMP_DEV,"/tmp/",5) && getenv("TMPDIR")) { data/lilo-24.2/src/device.c:212: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. strcpy(name,getenv("TMPDIR")); data/lilo-24.2/src/device.c:556:10: [3] (random) random: 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. int fd, random; data/lilo-24.2/src/device.c:562:19: [3] (random) random: 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. && read(fd, &random, sizeof(random)) == sizeof(random) ) { data/lilo-24.2/src/device.c:562:34: [3] (random) random: 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. && read(fd, &random, sizeof(random)) == sizeof(random) ) { data/lilo-24.2/src/device.c:562:53: [3] (random) random: 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. && read(fd, &random, sizeof(random)) == sizeof(random) ) { data/lilo-24.2/src/device.c:567:13: [3] (random) random: 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. inited ^= random; data/lilo-24.2/src/device.c:570:2: [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(inited); data/lilo-24.2/src/device.c:606:2: [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(time(NULL)); data/lilo-24.2/src/geometry.c:1009:7: [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. if (realpath(dmdev, buf) == NULL) data/lilo-24.2/src/lilo.c:805:31: [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 (!new_root) new_root = getenv("ROOT"); data/lilo-24.2/src/lilo.c:808:6: [3] (misc) chroot: chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22). Make sure the program immediately chdir("/"), closes file descriptors, and drops root privileges, and that all necessary files (and no more!) are in the new root. if (chroot(new_root) < 0) die("chroot %s: %s",new_root,strerror(errno)); data/lilo-24.2/src/partition.c:715:9: [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(time(NULL)); /* seed the random number generator */ data/lilo-24.2/diagnose/cprintf.c:142:20: [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 unsigned char out[NUMLTH+1]; data/lilo-24.2/diagnose/test4.c:471: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 *vmode[4] = { "reserved", "40x25 color", data/lilo-24.2/diagnose/test4.c:1082: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 buf[SECTOR_SIZE]; data/lilo-24.2/diagnose/test4.c:1102: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 vesa[512]; data/lilo-24.2/diagnose/test5.c:261: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 ch[2]; data/lilo-24.2/diagnose/test5.c:340: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 cp[CL_LENGTH]; data/lilo-24.2/src/bitmap.h:70: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 magic[4]; /* "LILO" */ data/lilo-24.2/src/boot.c:261:6: [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(part, "disc"); data/lilo-24.2/src/boot.c:439:6: [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, n[8]; data/lilo-24.2/src/boot.c:441:11: [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. else sprintf((s=n),"0x%02x", code); data/lilo-24.2/src/boot.c:454:17: [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). if ((l_fd = open(loader,O_RDONLY)) < 0) data/lilo-24.2/src/boot.c:465: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(buff, chain->data, size); data/lilo-24.2/src/boot.c:474:14: [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). if ((p_fd = open(part,O_RDONLY)) < 0) data/lilo-24.2/src/boot.c:478:17: [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. if (read(p_fd,(char *) buff[0].par_c.ptable,PART_TABLE_SIZE) != data/lilo-24.2/src/boot.c:513: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(pos,drv_map,sizeof(drv_map)); data/lilo-24.2/src/boot.c:514: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(pos+sizeof(drv_map),prt_map,sizeof(prt_map)-2); data/lilo-24.2/src/bsect.c:60: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 secondary_map[SECTOR_SIZE]; data/lilo-24.2/src/bsect.c:61:17: [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 unsigned char table[SECTOR_SIZE]; /* keytable & params */ data/lilo-24.2/src/bsect.c:67: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 temp_map[PATH_MAX+1]; data/lilo-24.2/src/bsect.c:68: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 *fallback[MAX_IMAGES]; data/lilo-24.2/src/bsect.c:282: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 line[MAX_TOKEN+1]; data/lilo-24.2/src/bsect.c:331:25: [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. crc32((unsigned char *)password, i, poly[j]); data/lilo-24.2/src/bsect.c:370: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 buf[MAX_TOKEN+1]; data/lilo-24.2/src/bsect.c:398:6: [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(crcval, walk->crc, MAX_PW_CRC*sizeof(int)); data/lilo-24.2/src/bsect.c:426: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(crcval, walk->crc, MAX_PW_CRC*sizeof(int)); data/lilo-24.2/src/bsect.c:470: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). if ((fd = open(boot_dev,O_RDWR)) < 0) data/lilo-24.2/src/bsect.c:639: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(&bsect, First.data, MAX_BOOT_SIZE); data/lilo-24.2/src/bsect.c:652: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(secondary_map+SECTOR_SIZE-4, EX_MAG_STRING, 4); data/lilo-24.2/src/bsect.c:891:15: [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). if ((kt_fd = open(keytable,O_RDONLY)) < 0) data/lilo-24.2/src/bsect.c:903: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(&(menu->row), &(lhv.row), sizeof(lhv) - sizeof(lhv.size) - sizeof(lhv.magic)); data/lilo-24.2/src/bsect.c:1058: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 options[SECTOR_SIZE]; /* this is ugly */ data/lilo-24.2/src/bsect.c:1066: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 fallback_buf[SECTOR_SIZE]; data/lilo-24.2/src/bsect.c:1081:21: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. "read-only")) strcat(options,"ro "); data/lilo-24.2/src/bsect.c:1083:22: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. "read-write")) strcat(options,"rw "); data/lilo-24.2/src/bsect.c:1088:6: [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(strchr(options,0),"root=%x ",(unsigned int) st.st_dev); data/lilo-24.2/src/bsect.c:1100:6: [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(strchr(options,0),"root=%x ",dev_number(root)); data/lilo-24.2/src/bsect.c:1105: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(strchr(options,0),"ramdisk=%d ",to_number(ram_disk)); data/lilo-24.2/src/bsect.c:1123:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(options, "BOOT_FILE="); data/lilo-24.2/src/bsect.c:1430: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(menuparams.serial_no, serial_no, sizeof(serial_no)); data/lilo-24.2/src/bsect.c:1431: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(table+256, &menuparams, sizeof(menuparams)); data/lilo-24.2/src/bsect.c:1462: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(&bsect_wr.sector[space], &bsect, len); data/lilo-24.2/src/bsect.c:1621: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 temp_name[PATH_MAX+1]; data/lilo-24.2/src/bsect.c:1638:21: [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). if ((bck_file = open(backup_file,O_RDONLY)) < 0) data/lilo-24.2/src/bsect.c:1675: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(&bsect, &bsect_save, MAX_BOOT_SIZE); /* update the subject boot sector */ data/lilo-24.2/src/cfg.c:254:23: [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). else if (!(file = fopen(file_name = name,"r"))) { data/lilo-24.2/src/cfg.c:295: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 buffer[MAX_VAR_NAME+1]; data/lilo-24.2/src/cfg.c:354: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 buf[MAX_TOKEN+1]; data/lilo-24.2/src/cfg.c:621: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 name[MAX_TOKEN+1]; data/lilo-24.2/src/cfg.c:643: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). pw_file = fopen(pw_file_name, "w+"); data/lilo-24.2/src/cfg.c:647:25: [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 (!(pw_file = fopen(pw_file_name, "r"))) { data/lilo-24.2/src/cfg.c:652:27: [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). pw_file = fopen(pw_file_name, "w+"); data/lilo-24.2/src/common.c:236: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 lname[1024]; data/lilo-24.2/src/common.c:257:14: [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 buf[4096]; data/lilo-24.2/src/common.c:261:10: [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). fd = open(argv[1],O_RDONLY); data/lilo-24.2/src/common.h: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. ;*/ char name[MAX_IMAGE_NAME+1]; /* image name, NUL terminated data/lilo-24.2/src/common.h:86:17: [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 bytes_per_sector[2]; /* data/lilo-24.2/src/common.h:90:17: [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 reserved_sectors[2]; /* data/lilo-24.2/src/common.h:94:17: [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 root_dir_entries[2]; /* data/lilo-24.2/src/common.h:96:17: [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 total_sectors[2]; /* data/lilo-24.2/src/common.h:100:17: [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 sectors_per_FAT[2]; /* data/lilo-24.2/src/common.h:102:17: [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 sectors_per_track[2]; /* DOS v.3 data/lilo-24.2/src/common.h:104:17: [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 heads_per_cylinder[2]; /* DOS v.3 data/lilo-24.2/src/common.h:106:17: [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 hidden_sectors[4]; /* data/lilo-24.2/src/common.h:108:17: [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 total_sectors_long[4]; /* if total_sectors==0 data/lilo-24.2/src/common.h:110:17: [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 reserved[7]; /* pad to 32 bytes data/lilo-24.2/src/common.h:120:17: [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 jump[3]; /* jump to boot code data/lilo-24.2/src/common.h:122: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. ;*/ char system[8]; /* system ID data/lilo-24.2/src/common.h:142: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. ;*/ char signature[4]; /* "LILO" data/lilo-24.2/src/common.h:167: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. ;*/ char jump[6]; /* jump over the data data/lilo-24.2/src/common.h:169: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. ;*/ char signature[4]; /* "LILO" data/lilo-24.2/src/common.h:201: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. ;*/ char jump[6]; /* jump over the data data/lilo-24.2/src/common.h:203: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. ;*/ char signature[4]; /* "LILO" data/lilo-24.2/src/common.h:216:17: [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 ptable[PARTITION_ENTRY*PARTITION_ENTRIES]; /* part. table data/lilo-24.2/src/common.h:228: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 menu_sig[4]; /* "MENU" or "BMP4" signature, or NULs if not present data/lilo-24.2/src/common.h:240: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 title[MAX_MENU_TITLE+2]; /* MENU title to override default data/lilo-24.2/src/common.h:280: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 unused[150-MAX_BIOS_DEVICES*sizeof(int)-(MAX_RAID_DEVICES)*sizeof(int)-MAX_DESCR_SECS*sizeof(SECTOR_ADDR)]; /* spacer data/lilo-24.2/src/common.h:297:14: [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 bootcode[MAX_BOOT_SIZE]; data/lilo-24.2/src/common.h:301:14: [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 part[PART_TABLE_SIZE]; data/lilo-24.2/src/common.h:311:14: [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 sector[SECTOR_SIZE]; data/lilo-24.2/src/common.h:318:14: [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 sector[SECTOR_SIZE*MAX_DESCR_SECS]; data/lilo-24.2/src/common.h:327:14: [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 data[1]; data/lilo-24.2/src/common.h:349: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 signature[4]; /* 2: "HdrS" */ data/lilo-24.2/src/device.c:197: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 name[PATH_MAX]; data/lilo-24.2/src/device.c:238:25: [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). else if ((dev->fd = open(name,flags)) < 0) { data/lilo-24.2/src/device.c:269: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 tem[PATH_MAX], format[PATH_MAX]; data/lilo-24.2/src/device.c:277:6: [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(tem,"/dev/scsi/host%d/bus0/target0/lun0/", i); data/lilo-24.2/src/device.c:278:6: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(strcpy(format,tem),"disc"); data/lilo-24.2/src/device.c:280:6: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(strcpy(format,tem),"part%d"); data/lilo-24.2/src/device.c:288:6: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(format, "%d"); data/lilo-24.2/src/device.c:300: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 tem[PATH_MAX], tem2[PATH_MAX]; data/lilo-24.2/src/device.c:301: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 format[PATH_MAX]; data/lilo-24.2/src/device.c:314:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(strcpy(format,tem2), "part%d"); data/lilo-24.2/src/device.c:315:9: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. disc = strcat(tem2, "disc"); data/lilo-24.2/src/device.c:318:9: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(strcpy(format, name), "%d"); data/lilo-24.2/src/device.c:331: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 tmp[PATH_MAX]; data/lilo-24.2/src/device.c:422: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 temp_name[PATH_MAX]; data/lilo-24.2/src/device.c:454: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, *dir, suffix[16]; data/lilo-24.2/src/device.c:457: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(suffix, "%04X", device); data/lilo-24.2/src/device.c:485:16: [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). bck_file = open(backup_file, O_RDONLY); data/lilo-24.2/src/device.c:561:15: [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). && (fd = open(RANDOM, O_RDONLY)) > 0 data/lilo-24.2/src/device.c:770: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 nt[PART_MAX]; /* flag partitions which might be NT */ data/lilo-24.2/src/device.c:900: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). if (!pp_fd && (pp_fd = fopen(PARTITIONS, "r"))==NULL) { data/lilo-24.2/src/device.c:902: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). if ((pp_fd = fopen(PARTITIONS, "r"))==NULL || fetch()) { data/lilo-24.2/src/edit.c:71: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 buf[MAX_TOKEN+1]; data/lilo-24.2/src/edit.c:156: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 buf[1024]; data/lilo-24.2/src/edit.c:190:14: [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 buffer[256]; data/lilo-24.2/src/edit.c:229: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). if (!(fdat = fopen(datfile, "w"))) pdie("Open .dat file"); data/lilo-24.2/src/edit.c:281:11: [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). ifd = open(bitmap_file, O_RDONLY); data/lilo-24.2/src/edit.c:283:11: [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). ofd = open(temp_file, O_CREAT|O_WRONLY, 0644); data/lilo-24.2/src/edit.c:351: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 n[4], *line, *end; data/lilo-24.2/src/edit.c:360: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(n, "%hd", dcol[i]); data/lilo-24.2/src/edit.c:822: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 val[8]; data/lilo-24.2/src/edit.c:835:10: [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. else sprintf(val,"%c%+3.1f", name[i], h); data/lilo-24.2/src/edit.c:872:11: [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). ifd = open(argv[1], O_RDONLY); data/lilo-24.2/src/geometry.c:149: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 line[MAX_LINE+1]; data/lilo-24.2/src/geometry.c:152: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 dm_version[32]; data/lilo-24.2/src/geometry.c:154: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 major_name[32]; data/lilo-24.2/src/geometry.c:161:14: [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(name,"r")) == NULL) data/lilo-24.2/src/geometry.c:164:25: [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 (name || (file = fopen(DFL_DISKTAB,"r")) != NULL) { data/lilo-24.2/src/geometry.c:190: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 = fopen("/proc/devices", "r"); data/lilo-24.2/src/geometry.c:233: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). dm_version_nr = atoi(dm_version); data/lilo-24.2/src/geometry.c:333:10: [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 max_partno[512] = { data/lilo-24.2/src/geometry.c:461:15: [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). if ((fd = open(name,O_RDWR)) < 0) return 0; /* was O_RDONLY */ data/lilo-24.2/src/geometry.c:474: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 name[PATH_MAX+1]; data/lilo-24.2/src/geometry.c:550:15: [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). if ((lvmfd = open(lvm_char, lbm->lv_dev, O_RDONLY)) < 0) data/lilo-24.2/src/geometry.c:588:19: [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). evms_fd = open(evms_blk, O_RDONLY); data/lilo-24.2/src/geometry.c:989:6: [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 dmdev[PATH_MAX+1]; data/lilo-24.2/src/geometry.c:990:6: [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+1]; data/lilo-24.2/src/geometry.c:1084: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). file = fopen(buf, "r"); data/lilo-24.2/src/geometry.c:1170: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 mdxxx[16]; data/lilo-24.2/src/geometry.c:1180:13: [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). if ((md_fd=open(mdxxx,O_NOACCESS)) < 0) data/lilo-24.2/src/geometry.c:1183:17: [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). if ((md_fd=open(mdxxx,O_NOACCESS)) < 0) data/lilo-24.2/src/geometry.c:1371:20: [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). if ((geo->fd = open(name,flags)) < 0) data/lilo-24.2/src/geometry.c:1420:25: [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). else if ((geo->fd = open(name,O_NOACCESS)) < 0) data/lilo-24.2/src/lilo.c:262: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 buffer[SECTOR_SIZE]; data/lilo-24.2/src/lilo.c:265: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 buffer[SECTOR_SIZE]; data/lilo-24.2/src/lilo.c:277:15: [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). if ((fd = open(map_file,O_RDONLY))<=0) data/lilo-24.2/src/lilo.c:807: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). pp_fd = fopen(PARTITIONS, "r"); data/lilo-24.2/src/map.c:48:15: [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). if ((fd = open(name,O_RDWR)) < 0) die("open %s: %s",name,strerror(errno)); data/lilo-24.2/src/map.c:83: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 buffer[SECTOR_SIZE]; data/lilo-24.2/src/map.c:295: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 buffer[SECTOR_SIZE]; data/lilo-24.2/src/map.c:329: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(buffer+offset,&walk->addr,sizeof(SECTOR_ADDR)); data/lilo-24.2/src/map.c:426: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 buff[SECTOR_SIZE]; data/lilo-24.2/src/map.c:451: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 buff[SECTOR_SIZE]; data/lilo-24.2/src/map.c:460: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(buff, data, count); data/lilo-24.2/src/partition.c:94:15: [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). if ((fd = open(device, O_RDONLY)) < 0) pdie("part_nowrite check:"); data/lilo-24.2/src/partition.c:145: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 backup_file[PATH_MAX+1]; data/lilo-24.2/src/partition.c:446:11: [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). pfd = open(table, O_RDONLY); data/lilo-24.2/src/partition.c:601:15: [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). if ((fd = open(part, O_RDWR)) < 0) data/lilo-24.2/src/partition.c:625:15: [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). if ((fd = open(part, !which ? O_RDONLY : O_RDWR)) < 0) data/lilo-24.2/src/partition.c:682:13: [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). if ((fd=open(part,O_RDWR)) < 0) die("Cannot open %s: %s", part,strerror(errno)); data/lilo-24.2/src/partition.c:695:14: [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). if ((nfd=open(what,O_RDONLY)) < 0) die("Cannot open %s: %s",what,strerror(errno)); data/lilo-24.2/src/partition.c:698: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(&buf, extended_pt ? Mbr2.data : Mbr.data, MAX_BOOT_SIZE); data/lilo-24.2/src/partition.c:753:13: [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). if ((fd=open(part,O_RDONLY))<0) die("Cannot open '%s'", part); data/lilo-24.2/src/probe.c:50:13: [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 b[5*SECTOR_SIZE]; data/lilo-24.2/src/probe.c:53:7: [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 signature[4]; data/lilo-24.2/src/probe.c:68:7: [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 signature[4]; data/lilo-24.2/src/probe.c:95: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 warned[16]; data/lilo-24.2/src/probe.c:180:13: [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). if ((fd=open(DEV_DIR "/mem", O_RDONLY)) < 0) return buf_valid=1; data/lilo-24.2/src/probe.c:235:13: [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). if ((fd=open(DEV_DIR "/mem", O_WRONLY)) < 0) pdie("purge: can't open " DEV_DIR "/mem"); data/lilo-24.2/src/probe.c:548: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 s[16]; data/lilo-24.2/src/probe.c:552: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(cp,"%u",n/k); data/lilo-24.2/src/probe.c:557: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(cp,",%03u",n/k); data/lilo-24.2/src/probe.c:568: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 ch_ser[24] = { 0 }; data/lilo-24.2/src/probe.c:577:25: [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. if (geom.serial_no) sprintf(ch_ser, "vol-ID: %08X", geom.serial_no); data/lilo-24.2/src/probe.c:633: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 bt[4], *ty, start[32], end[32], type[8]; data/lilo-24.2/src/probe.c:642:5: [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(bt," "); data/lilo-24.2/src/probe.c:643: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(type, "0x%02x", (int)pt.sys_ind); data/lilo-24.2/src/probe.c:644: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(start, "%4d:%d:%d", data/lilo-24.2/src/probe.c:648: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(end, "%4d:%d:%d", data/lilo-24.2/src/probe.c:656:6: [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(bt+1,"%02x", (int)pt.boot_ind); data/lilo-24.2/src/probe.c:940:14: [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 part[PART_TABLE_SIZE]; data/lilo-24.2/src/probe.c:941:14: [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 extra[8]; data/lilo-24.2/src/probe.h:104:16: [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 sig[4]; data/lilo-24.2/src/probe.h:146:16: [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 sig[4]; data/lilo-24.2/src/raid.c: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. static char *raid_mbr[MAX_RAID]; data/lilo-24.2/src/raid.c:45: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 *raid_list[MAX_RAID]; data/lilo-24.2/src/raid.c:237:6: [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 new_name[MAX_TOKEN+1]; data/lilo-24.2/src/raid.c:380:14: [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). if ((md_fd=open(scan,O_NOACCESS)) < 0) data/lilo-24.2/src/shs2.c:190:7: [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((BYTE*)&W+remain, buffer, SHS_BLOCKSIZE-remain); data/lilo-24.2/src/shs2.c:201:15: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (count) memcpy((BYTE*)&W+remain, buffer, count); data/lilo-24.2/src/temp.c:90:14: [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 data[NBUF]; data/lilo-24.2/src/temp.c:92:15: [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). if ((fd = open(file, O_RDONLY)) < 0) exit(1); data/lilo-24.2/src/vesainfo.h:19:7: [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 space[512]; data/lilo-24.2/src/vesainfo.h:21:10: [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 Signature[4]; data/lilo-24.2/diagnose/bios.c:111:13: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. pop ds ! equal to the SS data/lilo-24.2/diagnose/bios.c:219:1: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd,buf,len) data/lilo-24.2/diagnose/cprintf.c:105: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). c = strlen(cp); data/lilo-24.2/diagnose/test4.c:23:15: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define getch getchar data/lilo-24.2/diagnose/test5.c:24:15: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define getch getchar data/lilo-24.2/src/boot.c:70:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,(char *) &buff,SECTOR_SIZE) != SECTOR_SIZE) data/lilo-24.2/src/boot.c:73:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,(char *) &hdr,sizeof(hdr)) != sizeof(hdr)) data/lilo-24.2/src/boot.c:249: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). i = strlen(part); data/lilo-24.2/src/boot.c:342: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 (part && strlen(part)>0 && strlen(part)<=2) { data/lilo-24.2/src/boot.c:342: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). if (part && strlen(part)>0 && strlen(part)<=2) { data/lilo-24.2/src/boot.c:395:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(b_fd, buff[0].sector, SECTOR_SIZE*(SETUPSECS-1)) == data/lilo-24.2/src/boot.c:404:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((size = read(b_fd, (char *)&magic, 2)) != 2) { data/lilo-24.2/src/boot.c:456:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((size = read(l_fd,buff,sizeof(buff)+1)) < 0) data/lilo-24.2/src/boot.c:478:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(p_fd,(char *) buff[0].par_c.ptable,PART_TABLE_SIZE) != data/lilo-24.2/src/bsect.c:130: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(options) > COMMAND_LINE_SIZE-1) { data/lilo-24.2/src/bsect.c:321:10: [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 i = strlen(password); data/lilo-24.2/src/bsect.c:351: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). i = strlen(pass); data/lilo-24.2/src/bsect.c:361: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). int i = strlen(cp); data/lilo-24.2/src/bsect.c:375:15: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((ch=getchar())!='\n') if (i<MAX_TOKEN) buf[i++]=ch; data/lilo-24.2/src/bsect.c:489:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,(char *) &bsect,SECTOR_SIZE) != SECTOR_SIZE) data/lilo-24.2/src/bsect.c:556:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(menu->menu_sig, "MENU", 4); data/lilo-24.2/src/bsect.c:802:47: [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). while (*walk && strncmp(serial+2,walk,(i=strlen(walk)))) { data/lilo-24.2/src/bsect.c:893:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(kt_fd,table,256) != 256) data/lilo-24.2/src/bsect.c:913: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). if (strlen(scheme) > MAX_MENU_TITLE) data/lilo-24.2/src/bsect.c:915:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(menu->title, scheme, MAX_MENU_TITLE); data/lilo-24.2/src/bsect.c:916:24: [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). menu->len_title = strlen(menu->title); data/lilo-24.2/src/bsect.c:989: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(label) > MAX_IMAGE_NAME) die("Image name, label, or alias is too long: '%s'",label); data/lilo-24.2/src/bsect.c:1000:40: [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 ((((descr->flags & FLAG_SINGLE) && strlen(label) == 1) || data/lilo-24.2/src/bsect.c:1002:4: [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(descrs.d.descr[other].name) == 1)) && data/lilo-24.2/src/bsect.c:1090: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). else if (strlen(root)>12 && !strncmp(root,"/dev/mapper/",12)) { data/lilo-24.2/src/bsect.c:1093: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). else if (strlen(root)>6 && !strncmp(root,"LABEL=",6)) { data/lilo-24.2/src/bsect.c:1096: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). else if (strlen(root)>5 && !strncmp(root,"UUID=",5)) { data/lilo-24.2/src/bsect.c:1125:2: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(options, " "); data/lilo-24.2/src/bsect.c:1131: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(append) > COMMAND_LINE_SIZE-1) die("Command line options > %d", COMMAND_LINE_SIZE-1); data/lilo-24.2/src/bsect.c:1132:3: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(strcat(options,append)," "); data/lilo-24.2/src/bsect.c:1140: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). if (strlen(options)+strlen(append_local) > SECTOR_SIZE-1) die("Command line options > %d", COMMAND_LINE_SIZE-1); data/lilo-24.2/src/bsect.c:1140: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 (strlen(options)+strlen(append_local) > SECTOR_SIZE-1) die("Command line options > %d", COMMAND_LINE_SIZE-1); data/lilo-24.2/src/bsect.c:1276: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(descrs.d.descr[this_image].name) > 1 && data/lilo-24.2/src/bsect.c:1277: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). (!alias || strlen(alias) > 1)) data/lilo-24.2/src/bsect.c:1647:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(bck_file,(char *) &bsect,PART_TABLE_OFFSET) != PART_TABLE_OFFSET) data/lilo-24.2/src/cfg.c:285:23: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!back) return getc(file); data/lilo-24.2/src/cfg.c:305:10: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(file); data/lilo-24.2/src/cfg.c:307:14: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(file); data/lilo-24.2/src/cfg.c:309:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(file); data/lilo-24.2/src/cfg.c:315:10: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(file); data/lilo-24.2/src/cfg.c:320:7: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ch = getc(file); data/lilo-24.2/src/common.c:263:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd,buf,sizeof(buf)); data/lilo-24.2/src/common.c:266:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fd,buf,sizeof(buf)); data/lilo-24.2/src/device.c:213:20: [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(name+strlen(name),TMP_DEV+4,count); data/lilo-24.2/src/device.c:271: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). int k = strlen(DEV_DISK_DIR) + 3; data/lilo-24.2/src/device.c:304: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). int j = strlen(DEV_DISK_DIR) + 3; data/lilo-24.2/src/device.c:463: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). else if (strlen(name+1)==4) { /* && the suffix doesn't match */ data/lilo-24.2/src/device.c:468:3: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(name+1,"."); data/lilo-24.2/src/device.c:475:6: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(backup_file,"."); data/lilo-24.2/src/device.c:562:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). && read(fd, &random, sizeof(random)) == sizeof(random) ) { data/lilo-24.2/src/device.c:626:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, (char*)&buff, SECTOR_SIZE)!=SECTOR_SIZE) data/lilo-24.2/src/device.c:715:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &buf, sizeof(buf)) != sizeof(buf)) { data/lilo-24.2/src/device.c:947:38: [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(DEV_DISK_DIR "/", next, strlen(DEV_DISK_DIR)+1) != 0) name = next-(strlen(DEV_DISK_DIR)+1); data/lilo-24.2/src/device.c:947:81: [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(DEV_DISK_DIR "/", next, strlen(DEV_DISK_DIR)+1) != 0) name = next-(strlen(DEV_DISK_DIR)+1); data/lilo-24.2/src/device.c:950:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name, DEV_DISK_DIR "/", strlen(DEV_DISK_DIR)+1); data/lilo-24.2/src/device.c:950: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). strncpy(name, DEV_DISK_DIR "/", strlen(DEV_DISK_DIR)+1); data/lilo-24.2/src/edit.c:76:15: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while((ch=getchar())!='\n') if (i<MAX_TOKEN) buf[i++]=ch; data/lilo-24.2/src/edit.c:95:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, (void*)fh, sizeof(BITMAPFILEHEADER)) != data/lilo-24.2/src/edit.c:98:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &size, sizeof(size)) != sizeof(size)) return -1; data/lilo-24.2/src/edit.c:100:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, (char*)&bmh2+sizeof(size), sizeof(BITMAPHEADER2)-sizeof(size)) data/lilo-24.2/src/edit.c:113:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, (char*)bmh+sizeof(size), sizeof(BITMAPHEADER)-sizeof(size)) data/lilo-24.2/src/edit.c:125:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &palette[i], n) != n) return -1; data/lilo-24.2/src/edit.c:132:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &size, sizeof(size)) != sizeof(size)) return -1; data/lilo-24.2/src/edit.c:134:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, (char*)lh+sizeof(size), sizeof(*lh)-sizeof(size)) != data/lilo-24.2/src/edit.c:166:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(ifd, buf, sizeof(buf)); data/lilo-24.2/src/edit.c:278: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). temp_file = strcat(strcpy(alloc(strlen(bitmap_file)+strlen(MAP_TMP_APP)+1), data/lilo-24.2/src/edit.c:278:57: [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). temp_file = strcat(strcpy(alloc(strlen(bitmap_file)+strlen(MAP_TMP_APP)+1), data/lilo-24.2/src/edit.c:675:40: [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). bitmap_file = strcat(strcpy(alloc(strlen(config_file) + strlen(bitmap_file) + 1), data/lilo-24.2/src/edit.c:675:62: [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). bitmap_file = strcat(strcpy(alloc(strlen(config_file) + strlen(bitmap_file) + 1), data/lilo-24.2/src/edit.c:684: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). bitmap_file = alloc(strlen(config_file) + strlen(BMP_BMP) + 1); data/lilo-24.2/src/edit.c:684:44: [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). bitmap_file = alloc(strlen(config_file) + strlen(BMP_BMP) + 1); data/lilo-24.2/src/geometry.c:171: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 (strspn(line," \t") != strlen(line)) { data/lilo-24.2/src/geometry.c:202:6: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (sscanf(line, "%d %31s\n", &major, major_name) != 2) continue; data/lilo-24.2/src/geometry.c:462:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). yes = read(fd,&buff,1) == 1 && ioctl(fd,HDIO_GETGEO,&dummy) >= 0; data/lilo-24.2/src/geometry.c:995:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dmdev, dev.name, PATH_MAX); data/lilo-24.2/src/geometry.c:1007:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(slash, buf, PATH_MAX - (slash-dmdev)); data/lilo-24.2/src/geometry.c:1012:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dmdev, buf, PATH_MAX); data/lilo-24.2/src/lilo.c:217:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,buf,sizeof(buf)) != sizeof(buf)) data/lilo-24.2/src/lilo.c:280:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,buffer,SECTOR_SIZE) != SECTOR_SIZE) data/lilo-24.2/src/lilo.c:282:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,(char*)&descrs,sizeof(descrs)) != sizeof(descrs)) data/lilo-24.2/src/lilo.c:287:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,(char*)¶m2,sizeof(param2)) != sizeof(param2)) data/lilo-24.2/src/lilo.c:291:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,(char*)&menu,sizeof(menu)) != sizeof(menu)) data/lilo-24.2/src/lilo.c:469:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,addr,4*sizeof(SECTOR_ADDR)) != data/lilo-24.2/src/lilo.c:475:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,buffer,SECTOR_SIZE) != SECTOR_SIZE) data/lilo-24.2/src/lilo.c:488:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,buffer,SECTOR_SIZE) != SECTOR_SIZE) data/lilo-24.2/src/lilo.c:726:29: [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). *(reboot_arg = alloc(strlen(param)+1)) = 0; data/lilo-24.2/src/lilo.c:729:8: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(reboot_arg = ralloc(reboot_arg, data/lilo-24.2/src/lilo.c:730: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). strlen(reboot_arg)+strlen(param)+2)," "); data/lilo-24.2/src/lilo.c:730: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). strlen(reboot_arg)+strlen(param)+2)," "); data/lilo-24.2/src/map.c:46: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(str) >= SECTOR_SIZE-2) data/lilo-24.2/src/map.c:50:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,(char *) &descrs,sizeof(descrs)) != sizeof(descrs)) data/lilo-24.2/src/map.c:71:30: [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 ((size = write(fd,str,strlen(str)+1)) < 0) data/lilo-24.2/src/map.c:73: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 (size != strlen(str)+1) die("map_patch_first: Bad write ?!?"); data/lilo-24.2/src/map.c:434:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). count = read(geo->fd, buff, SECTOR_SIZE); data/lilo-24.2/src/partition.c:64: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). k = strlen(str); data/lilo-24.2/src/partition.c:95:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, bs.sector, sizeof(bs)) != SECTOR_SIZE) pdie("part_nowrite: read:"); data/lilo-24.2/src/partition.c:124:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (SECTOR_SIZE != read(fd, bs.sector, sizeof(bs)) ) pdie("part_nowrite swap check:"); data/lilo-24.2/src/partition.c:167:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd, &bs, sizeof(bs)) != sizeof(bs) ) pdie("bs read"); data/lilo-24.2/src/partition.c:173:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!(size = read(fd,(char *) part_table, sizeof(struct partition)* data/lilo-24.2/src/partition.c:176:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ( read(fd, &boot_sig, sizeof(boot_sig)) != sizeof(boot_sig) || data/lilo-24.2/src/partition.c:192:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, part_table, sizeof(part_table)) != sizeof(part_table)) die("secondary read pt failed"); data/lilo-24.2/src/partition.c:193:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ( read(fd, &boot_sig, sizeof(boot_sig)) != sizeof(boot_sig) || data/lilo-24.2/src/partition.c:427: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). i = other[strlen(other)-1] - '0'; data/lilo-24.2/src/partition.c:450:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(pfd, part_table, sizeof(part_table))!=sizeof(part_table)) data/lilo-24.2/src/partition.c:453: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). partition = other[strlen(other)-1] - '0'; data/lilo-24.2/src/partition.c:508: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). if (strlen(tmp) < 7 || !(here = strrchr(tmp,'_')) || data/lilo-24.2/src/partition.c:639:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,&flag,1) != 1) die("read: %s",strerror(errno)); data/lilo-24.2/src/partition.c:653:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,&ptype,1) != 1) die("read: %s",strerror(errno)); data/lilo-24.2/src/partition.c:687:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,&buf,SECTOR_SIZE) != SECTOR_SIZE) die("read %s: %s",part, strerror(errno)); data/lilo-24.2/src/partition.c:696:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(nfd,buf,MAX_BOOT_SIZE) != MAX_BOOT_SIZE) die("read %s: %s",what,strerror(errno)); data/lilo-24.2/src/partition.c:760:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) die("read header"); data/lilo-24.2/src/partition.c:765:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, pt, sizeof(pt)) != sizeof(pt)) die("read pt failed"); data/lilo-24.2/src/partition.c:766:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ( read(fd, &boot_sig, sizeof(boot_sig)) != sizeof(boot_sig) || data/lilo-24.2/src/partition.c:770:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, volid, sizeof(*volid)) != sizeof(*volid)) data/lilo-24.2/src/partition.c:794:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, pt, sizeof(pt)) != sizeof(pt)) die("secondary read pt failed"); data/lilo-24.2/src/partition.c:795:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ( read(fd, &boot_sig, sizeof(boot_sig)) != sizeof(boot_sig) || data/lilo-24.2/src/probe.c:184:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &buf.b, get) != get) return buf_valid=1; data/lilo-24.2/src/probe.c:885: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). n = strlen(pr->cmd); data/lilo-24.2/src/probe.c:977:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,extra,sizeof(extra))!= sizeof(extra)) data/lilo-24.2/src/probe.c:982:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd,part,sizeof(part))!= sizeof(part)) data/lilo-24.2/src/raid.c:316:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(new_name,dev.name,MAX_TOKEN); data/lilo-24.2/src/temp.c:100:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, data, nrd) != nrd) exit(1); ANALYSIS SUMMARY: Hits = 428 Lines analyzed = 16778 in approximately 0.59 seconds (28518 lines/second) Physical Source Lines of Code (SLOC) = 13302 Hits@level = [0] 702 [1] 127 [2] 185 [3] 14 [4] 100 [5] 2 Hits@level+ = [0+] 1130 [1+] 428 [2+] 301 [3+] 116 [4+] 102 [5+] 2 Hits/KSLOC@level+ = [0+] 84.9496 [1+] 32.1756 [2+] 22.6282 [3+] 8.72049 [4+] 7.66802 [5+] 0.150353 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.