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/lrzip-0.631+git200516/liblrzip.c Examining data/lrzip-0.631+git200516/lrzip_core.h Examining data/lrzip-0.631+git200516/md5.h Examining data/lrzip-0.631+git200516/runzip.c Examining data/lrzip-0.631+git200516/lrzip.c Examining data/lrzip-0.631+git200516/sha4.h Examining data/lrzip-0.631+git200516/stream.h Examining data/lrzip-0.631+git200516/lrzip_private.h Examining data/lrzip-0.631+git200516/md5.c Examining data/lrzip-0.631+git200516/aes.h Examining data/lrzip-0.631+git200516/rzip.h Examining data/lrzip-0.631+git200516/stream.c Examining data/lrzip-0.631+git200516/liblrzip_demo.c Examining data/lrzip-0.631+git200516/runzip.h Examining data/lrzip-0.631+git200516/util.c Examining data/lrzip-0.631+git200516/decompress_demo.c Examining data/lrzip-0.631+git200516/lzma/C/MyGuidDef.h Examining data/lrzip-0.631+git200516/lzma/C/LzFindMt.h Examining data/lrzip-0.631+git200516/lzma/C/LzFind.h Examining data/lrzip-0.631+git200516/lzma/C/LzmaDec.c Examining data/lrzip-0.631+git200516/lzma/C/LzFindMt.c Examining data/lrzip-0.631+git200516/lzma/C/LzmaDec.h Examining data/lrzip-0.631+git200516/lzma/C/MyWindows.h Examining data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c Examining data/lrzip-0.631+git200516/lzma/C/Alloc.c Examining data/lrzip-0.631+git200516/lzma/C/LzmaEnc.h Examining data/lrzip-0.631+git200516/lzma/C/windows.h Examining data/lrzip-0.631+git200516/lzma/C/LzmaLib.h Examining data/lrzip-0.631+git200516/lzma/C/LzmaLib.c Examining data/lrzip-0.631+git200516/lzma/C/7zCrcT8.c Examining data/lrzip-0.631+git200516/lzma/C/LzFind.c Examining data/lrzip-0.631+git200516/lzma/C/LzHash.h Examining data/lrzip-0.631+git200516/lzma/C/Threads.h Examining data/lrzip-0.631+git200516/lzma/C/7zCrc.h Examining data/lrzip-0.631+git200516/lzma/C/7zCrc.c Examining data/lrzip-0.631+git200516/lzma/C/Alloc.h Examining data/lrzip-0.631+git200516/lzma/C/Types.h Examining data/lrzip-0.631+git200516/lzma/C/basetyps.h Examining data/lrzip-0.631+git200516/lzma/C/Threads.c Examining data/lrzip-0.631+git200516/libzpaq/libzpaq.h Examining data/lrzip-0.631+git200516/libzpaq/libzpaq.cpp Examining data/lrzip-0.631+git200516/aes.c Examining data/lrzip-0.631+git200516/sha4.c Examining data/lrzip-0.631+git200516/Lrzip.h Examining data/lrzip-0.631+git200516/util.h Examining data/lrzip-0.631+git200516/liblrzip_private.h Examining data/lrzip-0.631+git200516/main.c Examining data/lrzip-0.631+git200516/rzip.c FINAL RESULTS: data/lrzip-0.631+git200516/decompress_demo.c:37: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(buf, file); data/lrzip-0.631+git200516/liblrzip.c:419: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(buf, lr->infilenames[0]); data/lrzip-0.631+git200516/liblrzip_demo.c:40:2: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, __VA_ARGS__); \ data/lrzip-0.631+git200516/lrzip.c:308:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(control->outfile, control->tmpdir); data/lrzip-0.631+git200516/lrzip.c:434:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(control->infile, control->tmpdir); data/lrzip-0.631+git200516/lrzip.c:704:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(infilecopy, control->infile); data/lrzip-0.631+git200516/lrzip.c:705: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(infilecopy, control->suffix); data/lrzip-0.631+git200516/lrzip.c:734: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(control->outfile, control->outdir); data/lrzip-0.631+git200516/lrzip.c:735: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(control->outfile, tmpoutfile); data/lrzip-0.631+git200516/lrzip.c:737: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(control->outfile, tmpoutfile); data/lrzip-0.631+git200516/lrzip.c:964:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(infilecopy, control->infile); data/lrzip-0.631+git200516/lrzip.c:965: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(infilecopy, control->suffix); data/lrzip-0.631+git200516/lrzip.c:1230: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(control->outfile, control->outname); data/lrzip-0.631+git200516/lrzip.c:1231: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(control->outfile, control->suffix); data/lrzip-0.631+git200516/lrzip.c:1250: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(control->outfile, control->outdir); data/lrzip-0.631+git200516/lrzip.c:1251: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(control->outfile, tmpinfile); data/lrzip-0.631+git200516/lrzip.c:1253: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(control->outfile, tmpinfile); data/lrzip-0.631+git200516/lrzip.c:1254: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(control->outfile, control->suffix); data/lrzip-0.631+git200516/lrzip.c:1379: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(control->tmpdir, eptr); data/lrzip-0.631+git200516/lrzip_private.h:88:23: [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). # define strdupa(str) strcpy(alloca(strlen(str) + 1), str) data/lrzip-0.631+git200516/lrzip_private.h:506:3: [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(control->msgout, format, ap); data/lrzip-0.631+git200516/lrzip_private.h:521:3: [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(control->msgerr, format, ap); data/lrzip-0.631+git200516/lzma/C/MyWindows.h:61:9: [4] (buffer) lstrcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. #define lstrcpy wcscpy data/lrzip-0.631+git200516/lzma/C/MyWindows.h:61:17: [4] (buffer) wcscpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. #define lstrcpy wcscpy data/lrzip-0.631+git200516/lzma/C/MyWindows.h:62:9: [4] (buffer) lstrcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). #define lstrcat wcscat data/lrzip-0.631+git200516/lzma/C/MyWindows.h:62:17: [4] (buffer) wcscat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). #define lstrcat wcscat data/lrzip-0.631+git200516/lzma/C/MyWindows.h:66:9: [4] (buffer) lstrcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using a function version that stops copying at the end of the buffer. #define lstrcpy strcpy data/lrzip-0.631+git200516/lzma/C/MyWindows.h:66:17: [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). #define lstrcpy strcpy data/lrzip-0.631+git200516/lzma/C/MyWindows.h:67:9: [4] (buffer) lstrcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). #define lstrcat strcat data/lrzip-0.631+git200516/lzma/C/MyWindows.h:67: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). #define lstrcat strcat data/lrzip-0.631+git200516/main.c:287:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fname, "%s/%s", indir, dp->d_name); data/lrzip-0.631+git200516/main.c:300:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(*dirlist + MAX_PATH_LEN * (*entries)++, fname); data/lrzip-0.631+git200516/main.c:466:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(control->outdir,optarg); data/lrzip-0.631+git200516/util.c:273:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(control->outdir, parametervalue); data/lrzip-0.631+git200516/util.c:308:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(control->tmpdir, parametervalue); data/lrzip-0.631+git200516/util.h:41:3: [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(stderr, format, ap); data/lrzip-0.631+git200516/util.h:67:3: [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(stderr, format, ap); data/lrzip-0.631+git200516/liblrzip.c:143:9: [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. eptr = getenv("LRZIP"); data/lrzip-0.631+git200516/liblrzip_demo.c:152:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, "bcdDefghHiklL:nN:o:O:p:qS:tTUvVw:z?")) != -1) { data/lrzip-0.631+git200516/lrzip.c:1365:9: [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. eptr = getenv("TMPDIR"); data/lrzip-0.631+git200516/lrzip.c:1367:10: [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. eptr = getenv("TMP"); data/lrzip-0.631+git200516/lrzip.c:1369:10: [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. eptr = getenv("TEMPDIR"); data/lrzip-0.631+git200516/lrzip.c:1371:10: [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. eptr = getenv("TEMP"); data/lrzip-0.631+git200516/main.c:351:9: [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. eptr = getenv("LRZIP"); data/lrzip-0.631+git200516/main.c:359:14: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, compat ? coptions : loptions, long_options, &i)) != -1) { data/lrzip-0.631+git200516/rzip.c:785:25: [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. st->hash_index[i] = ((random() << 16) ^ random()); data/lrzip-0.631+git200516/rzip.c:785:43: [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. st->hash_index[i] = ((random() << 16) ^ random()); data/lrzip-0.631+git200516/util.c:173:20: [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. buf[i] = (uchar)random(); data/lrzip-0.631+git200516/util.c:196:8: [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. HOME=getenv("HOME"); data/lrzip-0.631+git200516/aes.c:63: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 FSb[256]; data/lrzip-0.631+git200516/aes.c:72: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 RSb[256]; data/lrzip-0.631+git200516/aes.c:381:36: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const unsigned char input[16], data/lrzip-0.631+git200516/aes.c:382:30: [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 output[16] ) data/lrzip-0.631+git200516/aes.c:489:30: [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 iv[16], data/lrzip-0.631+git200516/aes.c:494: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 temp[16]; data/lrzip-0.631+git200516/aes.c:515:13: [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( temp, input, 16 ); data/lrzip-0.631+git200516/aes.c:521:13: [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( iv, temp, 16 ); data/lrzip-0.631+git200516/aes.c:536:13: [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( iv, output, 16 ); data/lrzip-0.631+git200516/aes.h:84:36: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const unsigned char input[16], data/lrzip-0.631+git200516/aes.h:85:30: [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 output[16] ); data/lrzip-0.631+git200516/aes.h:104:30: [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 iv[16], data/lrzip-0.631+git200516/aes.h:125:33: [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 iv[16], data/lrzip-0.631+git200516/decompress_demo.c:31:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[4096]; data/lrzip-0.631+git200516/liblrzip.c:45:7: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). in = tmpfile(); data/lrzip-0.631+git200516/liblrzip.c:416:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[4096]; data/lrzip-0.631+git200516/liblrzip.c:467: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(buf, dir, len); data/lrzip-0.631+git200516/liblrzip.c:669:6: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). d = tmpfile(); data/lrzip-0.631+git200516/liblrzip.c:717:6: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). d = tmpfile(); data/lrzip-0.631+git200516/liblrzip_demo.c:320: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[4096]; data/lrzip-0.631+git200516/libzpaq/libzpaq.h:141:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hbuf[20]; // result data/lrzip-0.631+git200516/libzpaq/libzpaq.h:497:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, s_buf, n); data/lrzip-0.631+git200516/libzpaq/libzpaq.h:513:3: [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(c_buf + *c_len, buf, n); data/lrzip-0.631+git200516/lrzip.c:98: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 aux[256]; data/lrzip-0.631+git200516/lrzip.c:105:17: [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(!(meminfo = fopen("/proc/meminfo", "r"))) data/lrzip-0.631+git200516/lrzip.c:140: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 magic[MAGIC_LEN] = { data/lrzip-0.631+git200516/lrzip.c:148:3: [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(&magic[6], &control->salt, 8); data/lrzip-0.631+git200516/lrzip.c:152:3: [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(&magic[6], &esize, 8); data/lrzip-0.631+git200516/lrzip.c:195: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(&control->major_version, &magic[4], 1); data/lrzip-0.631+git200516/lrzip.c:196: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(&control->minor_version, &magic[5], 1); data/lrzip-0.631+git200516/lrzip.c:205:3: [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(&v, &magic[6], 4); data/lrzip-0.631+git200516/lrzip.c:207:3: [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(&v, &magic[10], 4); data/lrzip-0.631+git200516/lrzip.c:210:3: [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(&expected_size, &magic[6], 8); data/lrzip-0.631+git200516/lrzip.c:240:3: [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(&control->salt, &magic[6], 8); data/lrzip-0.631+git200516/lrzip.c:253: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 magic[MAGIC_LEN]; data/lrzip-0.631+git200516/lrzip.c:309:3: [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(control->outfile, "lrzipout.XXXXXX"); data/lrzip-0.631+git200516/lrzip.c:312:11: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd_out = mkstemp(control->outfile); data/lrzip-0.631+git200516/lrzip.c:435:3: [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(control->infile, "lrzipin.XXXXXX"); data/lrzip-0.631+git200516/lrzip.c:436:11: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd_in = mkstemp(control->infile); data/lrzip-0.631+git200516/lrzip.c:445:3: [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(control->infile, "lrzipin.XXXXXX"); data/lrzip-0.631+git200516/lrzip.c:446:11: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd_in = mkstemp(control->infile); data/lrzip-0.631+git200516/lrzip.c:455:3: [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(control->infile, "/tmp/lrzipin.XXXXXX"); data/lrzip-0.631+git200516/lrzip.c:456:11: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd_in = mkstemp(control->infile); data/lrzip-0.631+git200516/lrzip.c:477: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 magic[MAGIC_LEN]; data/lrzip-0.631+git200516/lrzip.c:663: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(control->salt_pass, control->salt, SALT_LEN); data/lrzip-0.631+git200516/lrzip.c:664: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(control->salt_pass + SALT_LEN, passphrase, PASS_LEN - SALT_LEN); data/lrzip-0.631+git200516/lrzip.c:756: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). fd_in = open(infilecopy, O_RDONLY); data/lrzip-0.631+git200516/lrzip.c:764: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). fd_out = open(control->outfile, O_WRONLY | O_CREAT | O_EXCL, 0666); data/lrzip-0.631+git200516/lrzip.c:768: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). fd_out = open(control->outfile, O_WRONLY | O_CREAT | O_EXCL, 0666); data/lrzip-0.631+git200516/lrzip.c:776: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). fd_hist = open(control->outfile, O_RDONLY); data/lrzip-0.631+git200516/lrzip.c:789: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). fd_hist = open(control->outfile, O_RDONLY); data/lrzip-0.631+git200516/lrzip.c:975: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). fd_in = open(infilecopy, O_RDONLY); data/lrzip-0.631+git200516/lrzip.c:1161:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char md5_stored[MD5_DIGEST_SIZE]; data/lrzip-0.631+git200516/lrzip.c:1196: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 header[MAGIC_LEN]; data/lrzip-0.631+git200516/lrzip.c:1214: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). fd_in = open(control->infile, O_RDONLY); data/lrzip-0.631+git200516/lrzip.c:1258: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). fd_out = open(control->outfile, O_RDWR | O_CREAT | O_EXCL, 0666); data/lrzip-0.631+git200516/lrzip.c:1262: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). fd_out = open(control->outfile, O_RDWR | O_CREAT | O_EXCL, 0666); data/lrzip-0.631+git200516/lrzip_private.h:407:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char lzma_properties[5]; // lzma properties, encoded data/lrzip-0.631+git200516/lzma/C/LzmaDec.c:781:13: [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(p->tempBuf, src, inSize); data/lrzip-0.631+git200516/lzma/C/LzmaDec.c:869: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(dest, p->dic + dicPos, outSizeCur); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:352: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(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:353: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(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:356: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(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:357:3: [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(dest->isRep, p->isRep, sizeof(p->isRep)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:358:3: [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(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:359:3: [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(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:360:3: [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(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:361:3: [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(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:362:3: [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(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:363:3: [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(dest->reps, p->reps, sizeof(p->reps)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:364:3: [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(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:378: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(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:379: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(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:382: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(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:383:3: [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(dest->isRep, p->isRep, sizeof(p->isRep)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:384:3: [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(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:385:3: [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(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:386:3: [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(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:387:3: [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(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:388:3: [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(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:389:3: [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(dest->reps, p->reps, sizeof(p->reps)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:390:3: [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(dest->litProbs, p->litProbs, (0x300 << dest->lclp) * sizeof(CLzmaProb)); data/lrzip-0.631+git200516/lzma/C/LzmaEnc.c:2103:3: [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(p->data, data, size); data/lrzip-0.631+git200516/lzma/C/MyGuidDef.h:13: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. unsigned char Data4[8]; data/lrzip-0.631+git200516/main.c:276: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 fname[MAX_PATH_LEN]; data/lrzip-0.631+git200516/main.c:438:33: [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). control->compression_level = atoi(optarg); data/lrzip-0.631+git200516/main.c:443:23: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). control->ramsize = atol(optarg) * 1024 * 1024 * 100; data/lrzip-0.631+git200516/main.c:446:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). control->nice_val = atoi(optarg); data/lrzip-0.631+git200516/main.c:471:23: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). control->threads = atoi(optarg); data/lrzip-0.631+git200516/main.c:522:22: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). control->window = atol(optarg); data/lrzip-0.631+git200516/main.c:691:3: [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(&local_control, &base_control, sizeof(rzip_control)); data/lrzip-0.631+git200516/md5.c:66:23: [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 const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; data/lrzip-0.631+git200516/md5.c:89:3: [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 (cp, &v, sizeof v); data/lrzip-0.631+git200516/md5.c:124:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (&((char *) ctx->buffer)[bytes], fillbuf, (size - 2) * 4 - bytes); data/lrzip-0.631+git200516/md5.c:235: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 (&((char *) ctx->buffer)[left_over], buffer, add); data/lrzip-0.631+git200516/md5.c:244:11: [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 (ctx->buffer, data/lrzip-0.631+git200516/md5.c:262:32: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. md5_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); data/lrzip-0.631+git200516/md5.c:280: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 (&((char *) ctx->buffer)[left_over], buffer, len); data/lrzip-0.631+git200516/md5.c:286:11: [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 (ctx->buffer, &ctx->buffer[16], left_over); data/lrzip-0.631+git200516/runzip.c:190: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(buf, control->tmp_outbuf + control->hist_ofs, len); data/lrzip-0.631+git200516/runzip.c:464:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(md5_stored, control->md5_resblock, MD5_DIGEST_SIZE); data/lrzip-0.631+git200516/rzip.c:185: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(buf, control->sb.buf_low + offset, len); data/lrzip-0.631+git200516/rzip.c:196:3: [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 + n, srcbuf, m); data/lrzip-0.631+git200516/sha4.c:151:61: [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 void sha4_process( sha4_context *ctx, const unsigned char data[128] ) data/lrzip-0.631+git200516/sha4.c:241:9: [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( (void *) (ctx->buffer + left), data/lrzip-0.631+git200516/sha4.c:258:9: [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( (void *) (ctx->buffer + left), data/lrzip-0.631+git200516/sha4.c:263:23: [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 const unsigned char sha4_padding[128] = data/lrzip-0.631+git200516/sha4.c:278:47: [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. void sha4_finish( sha4_context *ctx, unsigned char output[64] ) data/lrzip-0.631+git200516/sha4.c:282: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 msglen[16]; data/lrzip-0.631+git200516/sha4.c:314:27: [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. void sha4( const unsigned char *input, int ilen, data/lrzip-0.631+git200516/sha4.c:315:21: [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 output[64], int is384 ) data/lrzip-0.631+git200516/sha4.h:44: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[128]; /*!< data block being processed */ data/lrzip-0.631+git200516/sha4.h:46: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 ipad[128]; /*!< HMAC: inner padding */ data/lrzip-0.631+git200516/sha4.h:47: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 opad[128]; /*!< HMAC: outer padding */ data/lrzip-0.631+git200516/sha4.h:79:47: [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. void sha4_finish( sha4_context *ctx, unsigned char output[64] ); data/lrzip-0.631+git200516/sha4.h:89:27: [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. void sha4( const unsigned char *input, int ilen, data/lrzip-0.631+git200516/sha4.h:90:21: [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 output[64], int is384 ); data/lrzip-0.631+git200516/stream.c:297:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char lzma_properties[5]; /* lzma properties, encoded */ data/lrzip-0.631+git200516/stream.c:375:3: [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(control->lzma_properties, lzma_properties, 5); data/lrzip-0.631+git200516/stream.c:635: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(control->tmp_outbuf + control->out_ofs, offset_buf, ret); data/lrzip-0.631+git200516/stream.c:712:3: [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, control->tmp_inbuf + control->in_ofs, len); data/lrzip-0.631+git200516/stream.c:720:3: [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, control->tmp_outbuf + control->out_ofs, len); data/lrzip-0.631+git200516/stream.c:1044: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(buf, c_type, 1); data/lrzip-0.631+git200516/stream.c:1045: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(buf + 1, c_len, 8); data/lrzip-0.631+git200516/stream.c:1046: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(buf + 9, u_len, 8); data/lrzip-0.631+git200516/stream.c:1047: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(buf + 17, last_head, 8); data/lrzip-0.631+git200516/stream.c:1052: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(c_type, buf, 1); data/lrzip-0.631+git200516/stream.c:1053: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(c_len, buf + 1, 8); data/lrzip-0.631+git200516/stream.c:1054: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(u_len, buf + 9, 8); data/lrzip-0.631+git200516/stream.c:1055: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(last_head, buf + 17, 8); data/lrzip-0.631+git200516/stream.c:1746:3: [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(sinfo->s[streamno].buf + sinfo->s[streamno].buflen, p, n); data/lrzip-0.631+git200516/stream.c:1773:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, s->buf + s->bufp, n); data/lrzip-0.631+git200516/util.c:170:7: [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("/dev/urandom", O_RDONLY); data/lrzip-0.631+git200516/util.c:186: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 *HOME, homeconf[255]; data/lrzip-0.631+git200516/util.c:189: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 line[255]; data/lrzip-0.631+git200516/util.c:192:7: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen("lrzip.conf", "r"); data/lrzip-0.631+git200516/util.c:199:9: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(homeconf, "r"); data/lrzip-0.631+git200516/util.c:205:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen("/etc/lrzip/lrzip.conf", "r"); data/lrzip-0.631+git200516/util.c:233:22: [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). control->window = atoi(parametervalue); data/lrzip-0.631+git200516/util.c:238:33: [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). control->compression_level = atoi(parametervalue); data/lrzip-0.631+git200516/util.c:290:24: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). control->nice_val = atoi(parametervalue); data/lrzip-0.631+git200516/util.c:346: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(buf, control->hash, HASH_LEN); data/lrzip-0.631+git200516/util.c:347: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(buf + HASH_LEN, salt, SALT_LEN); data/lrzip-0.631+git200516/util.c:348: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(buf + HASH_LEN + SALT_LEN, control->salt_pass, control->salt_pass_len); data/lrzip-0.631+git200516/util.c:351: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(buf, key, HASH_LEN); data/lrzip-0.631+git200516/util.c:352: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(buf + HASH_LEN, salt, SALT_LEN); data/lrzip-0.631+git200516/util.c:353: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(buf + HASH_LEN + SALT_LEN, control->salt_pass, control->salt_pass_len); data/lrzip-0.631+git200516/util.c:388:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp0, buf + N, M); data/lrzip-0.631+git200516/util.c:391:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf + N, buf + N - CBC_LEN, M); data/lrzip-0.631+git200516/util.c:392:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf + N - CBC_LEN, tmp1, CBC_LEN); data/lrzip-0.631+git200516/util.c:404:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp1, buf + N, M); data/lrzip-0.631+git200516/util.c:406:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf + N, tmp0, M); data/lrzip-0.631+git200516/util.c:407:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp1 + M, tmp0 + M, CBC_LEN - M); data/lrzip-0.631+git200516/decompress_demo.c:34: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). if (p && (strlen(p + 1) < 4)) data/lrzip-0.631+git200516/decompress_demo.c:35:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buf, file, p - file); data/lrzip-0.631+git200516/liblrzip.c:463:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(dir); data/lrzip-0.631+git200516/liblrzip_demo.c:98:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(s); data/lrzip-0.631+git200516/liblrzip_demo.c:103:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(s); data/lrzip-0.631+git200516/liblrzip_demo.c:325: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). len = strlen(infile); data/lrzip-0.631+git200516/liblrzip_demo.c:327:6: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buf, infile, len - 4); data/lrzip-0.631+git200516/libzpaq/libzpaq.cpp:49:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int Reader::read(char* buf, int n) { data/lrzip-0.631+git200516/libzpaq/libzpaq.cpp:314:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int ZPAQL::read(Reader* in2) { data/lrzip-0.631+git200516/libzpaq/libzpaq.cpp:1084:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). high=in->read(&buf[0], n); data/lrzip-0.631+git200516/libzpaq/libzpaq.cpp:1155:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). U32 n1=in->read(&buf[0], n); data/lrzip-0.631+git200516/libzpaq/libzpaq.cpp:1249:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). z.read(dec.in); data/lrzip-0.631+git200516/libzpaq/libzpaq.cpp:1512:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). z.read(&m); data/lrzip-0.631+git200516/libzpaq/libzpaq.h:58:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). virtual int read(char* buf, int n); // read to buf[n], return no. read data/lrzip-0.631+git200516/libzpaq/libzpaq.h:161:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(Reader* in2); // Read header data/lrzip-0.631+git200516/libzpaq/libzpaq.h:491:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(char *buf, int n) { data/lrzip-0.631+git200516/lrzip.c:257:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, magic, 24) != 24)) data/lrzip-0.631+git200516/lrzip.c:305:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). control->outfile = realloc(NULL, strlen(control->tmpdir) + 16); data/lrzip-0.631+git200516/lrzip.c:394:21: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((tmpchar = fgetc(tmpoutfp)) != EOF) data/lrzip-0.631+git200516/lrzip.c:431:28: [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). control->infile = malloc(strlen(control->tmpdir) + 15); data/lrzip-0.631+git200516/lrzip.c:482:13: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). tmpchar = getchar(); data/lrzip-0.631+git200516/lrzip.c:504:20: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((tmpchar = getchar()) != EOF) data/lrzip-0.631+git200516/lrzip.c:590:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(s, control->passphrase, PASS_LEN - SALT_LEN - 1); data/lrzip-0.631+git200516/lrzip.c:593:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(s); data/lrzip-0.631+git200516/lrzip.c:598:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(s); data/lrzip-0.631+git200516/lrzip.c:636:28: [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). control->salt_pass_len = strlen(passphrase) + SALT_LEN; data/lrzip-0.631+git200516/lrzip.c:703: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). infilecopy = alloca(strlen(control->infile) + strlen(control->suffix) + 1); data/lrzip-0.631+git200516/lrzip.c:703:50: [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). infilecopy = alloca(strlen(control->infile) + strlen(control->suffix) + 1); data/lrzip-0.631+git200516/lrzip.c:729:59: [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). control->outfile = malloc((control->outdir == NULL? 0: strlen(control->outdir)) + strlen(tmpoutfile) + 1); data/lrzip-0.631+git200516/lrzip.c:729:86: [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). control->outfile = malloc((control->outdir == NULL? 0: strlen(control->outdir)) + strlen(tmpoutfile) + 1); data/lrzip-0.631+git200516/lrzip.c:889:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, ctype, 1) != 1)) data/lrzip-0.631+git200516/lrzip.c:896:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, &c_len32, 4) != 4)) data/lrzip-0.631+git200516/lrzip.c:898:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, &u_len32, 4) != 4)) data/lrzip-0.631+git200516/lrzip.c:900:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, &last_head32, 4) != 4)) data/lrzip-0.631+git200516/lrzip.c:915:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, c_len, read_len) != read_len)) data/lrzip-0.631+git200516/lrzip.c:917:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, u_len, read_len) != read_len)) data/lrzip-0.631+git200516/lrzip.c:919:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, last_head, read_len) != read_len)) data/lrzip-0.631+git200516/lrzip.c:963: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). infilecopy = alloca(strlen(control->infile) + strlen(control->suffix) + 1); data/lrzip-0.631+git200516/lrzip.c:963:50: [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). infilecopy = alloca(strlen(control->infile) + strlen(control->suffix) + 1); data/lrzip-0.631+git200516/lrzip.c:997:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, &chunk_byte, 1) != 1)) data/lrzip-0.631+git200516/lrzip.c:1002:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, &control->eof, 1) != 1)) data/lrzip-0.631+git200516/lrzip.c:1004:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, &chunk_size, chunk_byte) != chunk_byte)) data/lrzip-0.631+git200516/lrzip.c:1106:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, &chunk_byte, 1) != 1)) data/lrzip-0.631+git200516/lrzip.c:1112:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, &control->eof, 1) != 1)) data/lrzip-0.631+git200516/lrzip.c:1114:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, &chunk_size, chunk_byte) != chunk_byte)) data/lrzip-0.631+git200516/lrzip.c:1167:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd_in, md5_stored, MD5_DIGEST_SIZE) != MD5_DIGEST_SIZE)) data/lrzip-0.631+git200516/lrzip.c:1227: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). control->outfile = malloc(strlen(control->outname) + strlen(control->suffix) + 1); data/lrzip-0.631+git200516/lrzip.c:1227:59: [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). control->outfile = malloc(strlen(control->outname) + strlen(control->suffix) + 1); data/lrzip-0.631+git200516/lrzip.c:1245:59: [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). control->outfile = malloc((control->outdir == NULL? 0: strlen(control->outdir)) + strlen(tmpinfile) + strlen(control->suffix) + 1); data/lrzip-0.631+git200516/lrzip.c:1245:86: [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). control->outfile = malloc((control->outdir == NULL? 0: strlen(control->outdir)) + strlen(tmpinfile) + strlen(control->suffix) + 1); data/lrzip-0.631+git200516/lrzip.c:1245:106: [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). control->outfile = malloc((control->outdir == NULL? 0: strlen(control->outdir)) + strlen(tmpinfile) + strlen(control->suffix) + 1); data/lrzip-0.631+git200516/lrzip.c:1374:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(eptr); data/lrzip-0.631+git200516/lrzip_private.h:88: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). # define strdupa(str) strcpy(alloca(strlen(str) + 1), str) data/lrzip-0.631+git200516/lrzip_private.h:92:29: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). # define strndupa(str, len) strncpy(alloca(len + 1), str, len) data/lrzip-0.631+git200516/lzma/C/MyWindows.h:63:17: [1] (buffer) wcslen: 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). #define lstrlen wcslen data/lrzip-0.631+git200516/lzma/C/MyWindows.h:68: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). #define lstrlen strlen data/lrzip-0.631+git200516/main.c:463: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). control->outdir = malloc(strlen(optarg) + 2); data/lrzip-0.631+git200516/main.c:467: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 (strcmp(optarg+strlen(optarg) - 1, "/")) /* need a trailing slash */ data/lrzip-0.631+git200516/main.c:468:5: [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(control->outdir, "/"); data/lrzip-0.631+git200516/runzip.c:131:20: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((tmpchar = getchar()) != EOF) { data/lrzip-0.631+git200516/rzip.c:826:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fileno(control->inFILE), offset_buf, (size_t)ret); data/lrzip-0.631+git200516/stream.c:672:13: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). tmpchar = getchar(); data/lrzip-0.631+git200516/stream.c:729:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, offset_buf, (size_t)ret); data/lrzip-0.631+git200516/util.c:175:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (unlikely(read(fd, buf, len) != len)) data/lrzip-0.631+git200516/util.c:215: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(line)) data/lrzip-0.631+git200516/util.c:216: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). line[strlen(line) - 1] = '\0'; data/lrzip-0.631+git200516/util.c:270: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). control->outdir = malloc(strlen(parametervalue) + 2); data/lrzip-0.631+git200516/util.c:274: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 (strcmp(parametervalue + strlen(parametervalue) - 1, "/")) data/lrzip-0.631+git200516/util.c:275:5: [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(control->outdir, "/"); data/lrzip-0.631+git200516/util.c:305:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). control->tmpdir = realloc(NULL, strlen(parametervalue) + 2); data/lrzip-0.631+git200516/util.c:309: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 (strcmp(parametervalue + strlen(parametervalue) - 1, "/")) data/lrzip-0.631+git200516/util.c:310:5: [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(control->tmpdir, "/"); data/lrzip-0.631+git200516/util.h:146:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(cksem->pipefd[0], &buf, 1); ANALYSIS SUMMARY: Hits = 275 Lines analyzed = 21729 in approximately 0.56 seconds (38555 lines/second) Physical Source Lines of Code (SLOC) = 16393 Hits@level = [0] 81 [1] 73 [2] 153 [3] 12 [4] 37 [5] 0 Hits@level+ = [0+] 356 [1+] 275 [2+] 202 [3+] 49 [4+] 37 [5+] 0 Hits/KSLOC@level+ = [0+] 21.7166 [1+] 16.7755 [2+] 12.3223 [3+] 2.98908 [4+] 2.25706 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.