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/genwqe-user-4.0.18/include/afu_regs.h Examining data/genwqe-user-4.0.18/include/ddcb.h Examining data/genwqe-user-4.0.18/include/deflate_ddcb.h Examining data/genwqe-user-4.0.18/include/deflate_fifo.h Examining data/genwqe-user-4.0.18/include/genwqe_vpd.h Examining data/genwqe-user-4.0.18/include/libcard.h Examining data/genwqe-user-4.0.18/include/libddcb.h Examining data/genwqe-user-4.0.18/include/libzHW.h Examining data/genwqe-user-4.0.18/include/linux/uapi/linux/genwqe/genwqe_card.h Examining data/genwqe-user-4.0.18/include/memcopy_ddcb.h Examining data/genwqe-user-4.0.18/include/zaddons.h Examining data/genwqe-user-4.0.18/lib/ddcb_card.c Examining data/genwqe-user-4.0.18/lib/deflate.c Examining data/genwqe-user-4.0.18/lib/inflate.c Examining data/genwqe-user-4.0.18/lib/libcard.c Examining data/genwqe-user-4.0.18/lib/libzHW.c Examining data/genwqe-user-4.0.18/lib/wrapper.c Examining data/genwqe-user-4.0.18/lib/wrapper.h Examining data/genwqe-user-4.0.18/lib/hardware.c Examining data/genwqe-user-4.0.18/lib/libddcb.c Examining data/genwqe-user-4.0.18/lib/software.c Examining data/genwqe-user-4.0.18/lib/card_defs.h Examining data/genwqe-user-4.0.18/lib/ddcb_capi.c Examining data/genwqe-user-4.0.18/lib/hw_defs.h Examining data/genwqe-user-4.0.18/misc/zpipe.c Examining data/genwqe-user-4.0.18/misc/zpipe_rnd.c Examining data/genwqe-user-4.0.18/misc/zpipe_append.c Examining data/genwqe-user-4.0.18/misc/zpipe_mt.c Examining data/genwqe-user-4.0.18/tools/force_cpu.h Examining data/genwqe-user-4.0.18/tools/genwqe_cksum.c Examining data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c Examining data/genwqe-user-4.0.18/tools/genwqe_echo.c Examining data/genwqe-user-4.0.18/tools/genwqe_ffdc.c Examining data/genwqe-user-4.0.18/tools/genwqe_gzip.c Examining data/genwqe-user-4.0.18/tools/genwqe_loadtree.c Examining data/genwqe-user-4.0.18/tools/genwqe_maint.c Examining data/genwqe-user-4.0.18/tools/genwqe_memcopy.c Examining data/genwqe-user-4.0.18/tools/genwqe_peek.c Examining data/genwqe-user-4.0.18/tools/genwqe_poke.c Examining data/genwqe-user-4.0.18/tools/genwqe_tools.h Examining data/genwqe-user-4.0.18/tools/genwqe_update.c Examining data/genwqe-user-4.0.18/tools/genwqe_vpd_common.c Examining data/genwqe-user-4.0.18/tools/genwqe_vpdconv.c Examining data/genwqe-user-4.0.18/tools/genwqe_vpdupdate.c Examining data/genwqe-user-4.0.18/tools/gzFile_test.c Examining data/genwqe-user-4.0.18/tools/force_cpu.c Examining data/genwqe-user-4.0.18/tools/zlib_mt_perf.c FINAL RESULTS: data/genwqe-user-4.0.18/lib/libcard.c:1658:3: [5] (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. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(ascii, str, sizeof(ascii) - 1); data/genwqe-user-4.0.18/lib/libcard.c:1669:3: [5] (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. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(ascii, str, sizeof(ascii) - 1); data/genwqe-user-4.0.18/lib/libddcb.c:169:3: [5] (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. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(ascii, str, sizeof(ascii) - 1); data/genwqe-user-4.0.18/lib/libddcb.c:180:3: [5] (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. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(ascii, str, sizeof(ascii) - 1); data/genwqe-user-4.0.18/tools/genwqe_gzip.c:387:3: [5] (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. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(ascii, str, sizeof(ascii) - 1); data/genwqe-user-4.0.18/tools/genwqe_gzip.c:398:3: [5] (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. Risk is high; the length parameter appears to be a constant, instead of computing the number of characters left. strncat(ascii, str, sizeof(ascii) - 1); data/genwqe-user-4.0.18/lib/card_defs.h:41: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, "%08x.%08x %s:%u: Error: " fmt, \ data/genwqe-user-4.0.18/lib/card_defs.h:46:4: [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, "%08x.%08x %s:%u: Warn: " fmt, \ data/genwqe-user-4.0.18/lib/card_defs.h:53:4: [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, fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/lib/card_defs.h:58:4: [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, "%08x.%08x %s:%u: Info: " fmt, \ data/genwqe-user-4.0.18/lib/ddcb_capi.c:71:4: [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(libddcb_fd_out, "%08x.%08x: " fmt, \ data/genwqe-user-4.0.18/lib/ddcb_capi.c:77:4: [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(libddcb_fd_out, "%08x.%08x: " fmt, \ data/genwqe-user-4.0.18/lib/ddcb_capi.c:83:4: [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(libddcb_fd_out, "%08x.%08x: " fmt, \ data/genwqe-user-4.0.18/lib/ddcb_capi.c:89:4: [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(libddcb_fd_out, "%08x.%08x: " fmt, \ data/genwqe-user-4.0.18/lib/hw_defs.h:46:4: [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(zedc_log, "%08x.%08x %s:%u: Error: " fmt, \ data/genwqe-user-4.0.18/lib/hw_defs.h:53:4: [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(zedc_log, "%08x.%08x %s:%u: Warn: " fmt, \ data/genwqe-user-4.0.18/lib/hw_defs.h:60:4: [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(zedc_log, fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/lib/hw_defs.h:65:4: [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(zedc_log, "%08x.%08x %s:%u: Info: " fmt, \ data/genwqe-user-4.0.18/lib/hw_defs.h:72:4: [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(zedc_log, "%08x.%08x %s:%u: Info: " fmt, \ data/genwqe-user-4.0.18/lib/libcard.c:249:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(card_dev, sizeof(card_dev) - 1, CARD_DEVICE, card_no); data/genwqe-user-4.0.18/lib/libcard.c:454:8: [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. rc = sscanf(namelist[n]->d_name, data/genwqe-user-4.0.18/lib/libcard.c:752:8: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. n = sscanf(ie->name, data/genwqe-user-4.0.18/lib/software.c:789:7: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. rc = snprintf(str, size, format, ap); data/genwqe-user-4.0.18/lib/software.c:799:7: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. rc = vsnprintf(str, size, format, ap); data/genwqe-user-4.0.18/lib/wrapper.h:66:3: [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(zlib_log, "%s:%u: Error: " fmt, \ data/genwqe-user-4.0.18/lib/wrapper.h:72:3: [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(zlib_log, "%s:%u: Warning: " fmt, \ data/genwqe-user-4.0.18/lib/wrapper.h:78:3: [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(zlib_log, "Info: " fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/lib/wrapper.h:84:4: [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(zlib_log, "### " fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/lib/wrapper.h:90:4: [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(zlib_log, "hhh " fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/lib/wrapper.h:96:4: [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(zlib_log, "sss " fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/misc/zpipe_append.c:584:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(diff_cmd, "diff -q %s %s", i_fname, n_fname); data/genwqe-user-4.0.18/misc/zpipe_append.c:585:7: [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. rc = system(diff_cmd); data/genwqe-user-4.0.18/misc/zpipe_mt.c:83:4: [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, fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/misc/zpipe_mt.c:576:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(diff_cmd, "xxd %s", o_fname); data/genwqe-user-4.0.18/misc/zpipe_mt.c:577:9: [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. rc = system(diff_cmd); data/genwqe-user-4.0.18/misc/zpipe_mt.c:597:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(diff_cmd, "diff -q %s %s", i_fname, n_fname); data/genwqe-user-4.0.18/misc/zpipe_mt.c:598:8: [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. rc = system(diff_cmd); data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:30:27: [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 DEBUG_PRINTF(...) printf(__VA_ARGS__) data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:263: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(desc, token); data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:422:8: [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 (sscanf(next_arg(), "%s", data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:428:8: [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 (sscanf(next_arg(), "%s", data/genwqe-user-4.0.18/tools/genwqe_gzip.c:69:3: [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, "gzip: " fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/tools/genwqe_maint.c:49:3: [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(fd_out, fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/tools/genwqe_maint.c:54:4: [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(fd_out, fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/tools/genwqe_maint.c:59:4: [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(fd_out, fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/tools/genwqe_maint.c:64:4: [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(fd_out, fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/tools/genwqe_memcopy.c:50:3: [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/genwqe-user-4.0.18/tools/genwqe_memcopy.c:55:4: [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/genwqe-user-4.0.18/tools/genwqe_memcopy.c:60:4: [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/genwqe-user-4.0.18/tools/genwqe_memcopy.c:65:4: [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/genwqe-user-4.0.18/tools/genwqe_memcopy.c:69:3: [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/genwqe-user-4.0.18/tools/genwqe_tools.h:122:3: [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, "%s:%u: Error: " fmt, \ data/genwqe-user-4.0.18/tools/genwqe_tools.h:131:4: [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(stdout, fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/tools/genwqe_tools.h:139:4: [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(stdout, fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/tools/genwqe_update.c:85:2: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(sysfs, sizeof(sysfs), SYSFS_GENWQE_TYPE, card_no); data/genwqe-user-4.0.18/tools/gzFile_test.c:57:3: [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, "gzFile_test: " fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/tools/gzFile_test.c:62:3: [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, fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/tools/zlib_mt_perf.c:113:4: [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, fmt, ## __VA_ARGS__); \ data/genwqe-user-4.0.18/tools/zlib_mt_perf.c:756:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(i_fname, "%s", optarg); data/genwqe-user-4.0.18/tools/zlib_mt_perf.c:757:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(c_fname, "%s", i_fname); data/genwqe-user-4.0.18/lib/ddcb_capi.c:1478:20: [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. const char *ttt = getenv("DDCB_TIMEOUT"); data/genwqe-user-4.0.18/lib/hardware.c:1606:15: [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. char *verb = getenv("ZLIB_VERBOSE"); data/genwqe-user-4.0.18/lib/hardware.c:1607:16: [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. char *accel = getenv("ZLIB_ACCELERATOR"); data/genwqe-user-4.0.18/lib/hardware.c:1608: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. char *ibuf_s = getenv("ZLIB_IBUF_TOTAL"); data/genwqe-user-4.0.18/lib/hardware.c:1609: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. char *obuf_s = getenv("ZLIB_OBUF_TOTAL"); data/genwqe-user-4.0.18/lib/hardware.c:1610:15: [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. char *card = getenv("ZLIB_CARD"); data/genwqe-user-4.0.18/lib/hardware.c:1611:21: [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. char *xcheck_str = getenv("ZLIB_CROSS_CHECK"); data/genwqe-user-4.0.18/lib/libddcb.c:552: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. const char *ddcb_trace_env = getenv("DDCB_TRACE"); data/genwqe-user-4.0.18/lib/libzHW.c:460: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. env = getenv("DDCB_DEBUG"); data/genwqe-user-4.0.18/lib/software.c:597:26: [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. const char *zlib_path = getenv("ZLIB_PATH"); data/genwqe-user-4.0.18/lib/wrapper.c:238: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. zlib_logfile = getenv("ZLIB_LOGFILE"); data/genwqe-user-4.0.18/lib/wrapper.c:245: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. trace = getenv("ZLIB_TRACE"); data/genwqe-user-4.0.18/lib/wrapper.c:249:18: [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. deflate_impl = getenv("ZLIB_DEFLATE_IMPL"); data/genwqe-user-4.0.18/lib/wrapper.c:258: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. inflate_impl = getenv("ZLIB_INFLATE_IMPL"); data/genwqe-user-4.0.18/lib/wrapper.c:267:22: [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. inflate_threshold = getenv("ZLIB_INFLATE_THRESHOLD"); data/genwqe-user-4.0.18/lib/wrapper.c:277:11: [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. method = getenv("_HZC_COMPRESSION_METHOD"); data/genwqe-user-4.0.18/misc/zpipe_append.c:427:8: [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. ch = getopt_long(argc, argv, "F:f:Eei:o:s:p:vh?", data/genwqe-user-4.0.18/misc/zpipe_mt.c:736:8: [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. ch = getopt_long(argc, argv, "X:d:Ppc:t:i:o:vh?", data/genwqe-user-4.0.18/misc/zpipe_rnd.c:95: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. chunk_i = rnd ? random() % CHUNK_i + 1 : CHUNK_i; data/genwqe-user-4.0.18/misc/zpipe_rnd.c:111: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. chunk_o = rnd ? random() % CHUNK_o + 1 : CHUNK_o; data/genwqe-user-4.0.18/misc/zpipe_rnd.c:194: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. chunk_i = rnd ? random() % CHUNK_i + 1 : CHUNK_i; data/genwqe-user-4.0.18/misc/zpipe_rnd.c:211: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. chunk_o = rnd ? random() % CHUNK_o + 1 : CHUNK_o; data/genwqe-user-4.0.18/misc/zpipe_rnd.c:412:8: [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. ch = getopt_long(argc, argv, "169D:F:rs:i:o:dvh?", data/genwqe-user-4.0.18/misc/zpipe_rnd.c:460:2: [3] (random) srandom: 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. srandom(seed); data/genwqe-user-4.0.18/tools/genwqe_cksum.c:294:8: [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. ch = getopt_long(argc, argv, "acC:X:Gs:i:vDVh", data/genwqe-user-4.0.18/tools/genwqe_echo.c:280:8: [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. ch = getopt_long(argc, argv, "pDC:A:c:fhl:i:s:qvX:HVu:e:", data/genwqe-user-4.0.18/tools/genwqe_echo.c:283:8: [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. ch = getopt_long(argc, argv, "pDC:A:c:fhl:i:s:qvX:HVe:", data/genwqe-user-4.0.18/tools/genwqe_ffdc.c:141:8: [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. ch = getopt_long(argc, argv, "C:QVvh", long_options, data/genwqe-user-4.0.18/tools/genwqe_gzip.c:656:26: [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. const char *accel_env = getenv("ZLIB_ACCELERATOR"); data/genwqe-user-4.0.18/tools/genwqe_gzip.c:658:28: [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. const char *card_no_env = getenv("ZLIB_CARD"); data/genwqe-user-4.0.18/tools/genwqe_gzip.c:708:8: [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. ch = getopt_long(argc, argv, data/genwqe-user-4.0.18/tools/genwqe_loadtree.c:109:8: [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. ch = getopt_long(argc, argv, "C:Vqhv", data/genwqe-user-4.0.18/tools/genwqe_maint.c:524:8: [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. ch = getopt_long(argc, argv, "C:f:c:i:m:Vqhvd", data/genwqe-user-4.0.18/tools/genwqe_memcopy.c:726:9: [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. cmd = getopt_long(argc, argv, "nqGDFi:o:p:s:c:C:A:X:vVhl:t:Y:", data/genwqe-user-4.0.18/tools/genwqe_peek.c:186:8: [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. ch = getopt_long(argc, argv, data/genwqe-user-4.0.18/tools/genwqe_poke.c:204:8: [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. ch = getopt_long(argc, argv, "m:p:C:A:X:w:i:c:Vqrvh", data/genwqe-user-4.0.18/tools/genwqe_update.c:284:8: [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. ch = getopt_long(argc, argv, "C:f:vVhp:x:", data/genwqe-user-4.0.18/tools/genwqe_update.c:331: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. env = getenv("GENWQE_SIM"); data/genwqe-user-4.0.18/tools/genwqe_vpdconv.c:98:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. option = getopt_long(argc, argv, "i:o:vVh", data/genwqe-user-4.0.18/tools/genwqe_vpdupdate.c:158:8: [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. ch = getopt_long(argc, argv, data/genwqe-user-4.0.18/tools/genwqe_vpdupdate.c:237: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. env = getenv("GENWQE_SIM"); data/genwqe-user-4.0.18/tools/gzFile_test.c:428:26: [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. const char *accel_env = getenv("ZLIB_ACCELERATOR"); data/genwqe-user-4.0.18/tools/gzFile_test.c:430:28: [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. const char *card_no_env = getenv("ZLIB_CARD"); data/genwqe-user-4.0.18/tools/gzFile_test.c:461:8: [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. ch = getopt_long(argc, argv, "123456789A:B:di:o:s:O:h?Vv", data/genwqe-user-4.0.18/tools/zlib_mt_perf.c:730:8: [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. ch = getopt_long(argc, argv, "Xd:f:Dc:t:i:o:NVvh?", data/genwqe-user-4.0.18/include/linux/uapi/linux/genwqe/genwqe_card.h:356: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 driver_version[64]; data/genwqe-user-4.0.18/lib/ddcb_capi.c:251: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(&pddcb->n.asiv[0], &cmd->asiv[0], DDCB_ASIV_LENGTH_ATS); data/genwqe-user-4.0.18/lib/ddcb_capi.c:276: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(&cmd->asv[0], (void *) &ddcb->asv[0], cmd->asv_length); data/genwqe-user-4.0.18/lib/ddcb_capi.c:367: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 device[64]; data/genwqe-user-4.0.18/lib/ddcb_capi.c:376:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(device, "/dev/cxl/afu%d.0m", ctx->card_no); data/genwqe-user-4.0.18/lib/ddcb_capi.c:377:7: [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(device, "/dev/cxl/afu%d.0s", ctx->card_no); data/genwqe-user-4.0.18/lib/deflate.c:295: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(&strm->wsp->dict[0], dictionary, dictLength); data/genwqe-user-4.0.18/lib/deflate.c:307: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(dest, source, sizeof(*dest)); data/genwqe-user-4.0.18/lib/deflate.c:314: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(dest->wsp->tree, source->wsp->tree, sizeof(*dest->wsp->tree)); data/genwqe-user-4.0.18/lib/hardware.c:338: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(s_dest, s_source, sizeof(*s_dest)); data/genwqe-user-4.0.18/lib/hardware.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(s_dest->ibuf_base, s_source->ibuf_base, data/genwqe-user-4.0.18/lib/hardware.c:391: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(s_dest->obuf_next, s_source->obuf_next, data/genwqe-user-4.0.18/lib/hardware.c:522: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(s->ibuf, strm->next_in, tocopy); data/genwqe-user-4.0.18/lib/hardware.c:561: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(strm->next_out, s->obuf_next, tocopy); data/genwqe-user-4.0.18/lib/hardware.c:1191: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(&e.d[e.avail_in], h->wsp->tree, len); data/genwqe-user-4.0.18/lib/hardware.c:1196: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(&e.d[e.avail_in], strm->next_in, len); data/genwqe-user-4.0.18/lib/hardware.c:1638:16: [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). zlib_card = atoi(card); data/genwqe-user-4.0.18/lib/inflate.c:294: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(target, src, strm->avail_in); data/genwqe-user-4.0.18/lib/inflate.c:456: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(&tmp, &strm->prefx[4], 4); data/genwqe-user-4.0.18/lib/inflate.c:713: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(&val32[0], &strm->postfx[0], 4); data/genwqe-user-4.0.18/lib/inflate.c:724: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(&val32[0], &strm->postfx[0], 8); data/genwqe-user-4.0.18/lib/inflate.c:737: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(&val32[0], &strm->postfx[0], 4); data/genwqe-user-4.0.18/lib/inflate.c:930: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(fname, "w+"); data/genwqe-user-4.0.18/lib/inflate.c:951: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[_POSIX_PATH_MAX]; data/genwqe-user-4.0.18/lib/inflate.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(&strm->wsp->dict[0], dictionary, dictLength); data/genwqe-user-4.0.18/lib/inflate.c:1464: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(dictionary, in_dict, strm->dict_len); data/genwqe-user-4.0.18/lib/libcard.c:246: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 card_dev[256]; // temp dev name data/genwqe-user-4.0.18/lib/libcard.c:250: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(card_dev, omode); data/genwqe-user-4.0.18/lib/libcard.c:790:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[sizeof(struct inotify_event) + PATH_MAX]; data/genwqe-user-4.0.18/lib/libcard.c:1647: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 ascii[17]; data/genwqe-user-4.0.18/lib/libcard.c:1648: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 str[2] = { 0x0, }; data/genwqe-user-4.0.18/lib/libcard.c:1731: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(upd->fname, O_EXCL|O_CREAT|O_WRONLY|O_TRUNC, 0644); data/genwqe-user-4.0.18/lib/libcard.c:1810: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(upd->fname, O_RDONLY); data/genwqe-user-4.0.18/lib/libcard.c:1921: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(vpd, buf, sizeof(*vpd)); data/genwqe-user-4.0.18/lib/libcard.c:1948: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, vpd, sizeof(*vpd)); data/genwqe-user-4.0.18/lib/libddcb.c:155: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 ascii[17]; data/genwqe-user-4.0.18/lib/libddcb.c:156: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 str[2] = { 0x0, }; data/genwqe-user-4.0.18/lib/libzHW.c:462:14: [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). zedc_dbg = atoi(env); data/genwqe-user-4.0.18/lib/software.c:737: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. return memcpy(dest, src, n); data/genwqe-user-4.0.18/lib/software.c:761:9: [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). return open(pathname, flags, mode); data/genwqe-user-4.0.18/lib/wrapper.c:240: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). zlib_log = fopen(zlib_logfile, "a+"); data/genwqe-user-4.0.18/lib/wrapper.c:691: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(dest, source, sizeof(*dest)); data/genwqe-user-4.0.18/lib/wrapper.c:703: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(w_dest, w_source, sizeof(*w_dest)); data/genwqe-user-4.0.18/lib/wrapper.c:1139: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(w->dictionary, dictionary, data/genwqe-user-4.0.18/lib/wrapper.c:1185: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(dictionary, w->dictionary, w->dictLength); data/genwqe-user-4.0.18/misc/zpipe.c:41: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 in[CHUNK]; data/genwqe-user-4.0.18/misc/zpipe.c:42: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 out[CHUNK]; data/genwqe-user-4.0.18/misc/zpipe.c:97: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 in[CHUNK]; data/genwqe-user-4.0.18/misc/zpipe.c:98: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 out[CHUNK]; data/genwqe-user-4.0.18/misc/zpipe_append.c:394: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 i_fname[64], o_fname[64], n_fname[64]; data/genwqe-user-4.0.18/misc/zpipe_append.c:395: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 diff_cmd[128]; data/genwqe-user-4.0.18/misc/zpipe_append.c:479: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(i_fname, "i_%d_%d.bin", _pattern, _pattern); data/genwqe-user-4.0.18/misc/zpipe_append.c:480: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(o_fname, "o_%d_%d.bin", _pattern, _pattern); data/genwqe-user-4.0.18/misc/zpipe_append.c:481: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_fname, "n_%d_%d.bin", _pattern, _pattern); data/genwqe-user-4.0.18/misc/zpipe_append.c:484: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). i_fp = fopen(i_fname, "w+"); data/genwqe-user-4.0.18/misc/zpipe_append.c:497: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). i_fp = fopen(i_fname, "r"); /* original data */ data/genwqe-user-4.0.18/misc/zpipe_append.c:501: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). o_fp = fopen(o_fname, "w+"); /* compressed data */ data/genwqe-user-4.0.18/misc/zpipe_append.c:523: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). o_fp = fopen(o_fname, "r"); /* original data */ data/genwqe-user-4.0.18/misc/zpipe_append.c:527: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). n_fp = fopen(n_fname, "w+"); /* new original data */ data/genwqe-user-4.0.18/misc/zpipe_mt.c:483: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 i_fname[64], o_fname[64], n_fname[64]; data/genwqe-user-4.0.18/misc/zpipe_mt.c:484: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 diff_cmd[128]; data/genwqe-user-4.0.18/misc/zpipe_mt.c:493:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(i_fname, "i_%08x_%08x_%d.bin", getpid(), sys_gettid(), i); data/genwqe-user-4.0.18/misc/zpipe_mt.c:494:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(o_fname, "o_%08x_%08x_%d.bin", getpid(), sys_gettid(), i); data/genwqe-user-4.0.18/misc/zpipe_mt.c:495:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(n_fname, "n_%08x_%08x_%d.bin", getpid(), sys_gettid(), i); data/genwqe-user-4.0.18/misc/zpipe_mt.c:497: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). i_fp = fopen(i_fname, "w+"); data/genwqe-user-4.0.18/misc/zpipe_mt.c:524: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). i_fp = fopen(i_fname, "r"); /* original data */ data/genwqe-user-4.0.18/misc/zpipe_mt.c:527: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). o_fp = fopen(o_fname, "w+"); /* compressed data */ data/genwqe-user-4.0.18/misc/zpipe_mt.c:558: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). o_fp = fopen(o_fname, "r"); /* original data */ data/genwqe-user-4.0.18/misc/zpipe_mt.c:562: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). n_fp = fopen(n_fname, "w+"); /* new original data */ data/genwqe-user-4.0.18/misc/zpipe_rnd.c:360: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(fname, "r"); data/genwqe-user-4.0.18/tools/genwqe_cksum.c:169: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). i_fp = fopen(in_f, "r"); data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:35:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char *arg_values[100]; data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:48: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 input_fn[MAX_LINE]; data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:49: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 output_fn[MAX_LINE]; data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:181: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[MAX_LINE]; data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:182: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 token[MAX_LINE]; data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:187: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 desc[MAX_LINE]; data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:197: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). ip = fopen(input_fn, "r"); data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:203: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). op = fopen(output_fn, "w"); data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:337: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). op = fopen(output_fn, "r+"); data/genwqe-user-4.0.18/tools/genwqe_gzip.c:373: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 ascii[17]; data/genwqe-user-4.0.18/tools/genwqe_gzip.c:374: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 str[2] = { 0x0, }; data/genwqe-user-4.0.18/tools/genwqe_gzip.c:451: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(fname, "r"); data/genwqe-user-4.0.18/tools/genwqe_gzip.c:478: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(fname, "w+"); data/genwqe-user-4.0.18/tools/genwqe_gzip.c:640: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 out_f[PATH_MAX]; data/genwqe-user-4.0.18/tools/genwqe_gzip.c:666:13: [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). card_no = atoi(card_no_env); data/genwqe-user-4.0.18/tools/genwqe_gzip.c:825: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). i_fp = fopen(in_f, "r"); data/genwqe-user-4.0.18/tools/genwqe_gzip.c:880: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). o_fp = fopen(out_f, "w+"); data/genwqe-user-4.0.18/tools/genwqe_loadtree.c:94: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[MAX_LINE]; data/genwqe-user-4.0.18/tools/genwqe_loadtree.c:139: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(filename, "r"); data/genwqe-user-4.0.18/tools/genwqe_maint.c:133: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 device[64]; data/genwqe-user-4.0.18/tools/genwqe_maint.c:136: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(device, "/dev/cxl/afu%d.0m", mctx->card); data/genwqe-user-4.0.18/tools/genwqe_maint.c:238:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char s[32]; data/genwqe-user-4.0.18/tools/genwqe_maint.c:591: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). fd_out = fopen(log_file, "w+"); data/genwqe-user-4.0.18/tools/genwqe_memcopy.c:766:22: [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 ((optarg && (((char *)optarg)[0] == '-')) data/genwqe-user-4.0.18/tools/genwqe_memcopy.c:775:22: [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 ((optarg && (((char *)optarg)[0] == '-')) data/genwqe-user-4.0.18/tools/genwqe_memcopy.c:786: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). ip.fpattern = fopen(optarg, "rb"); data/genwqe-user-4.0.18/tools/genwqe_memcopy.c:846:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ip.o_fp = fopen(out_f, "w+"); data/genwqe-user-4.0.18/tools/genwqe_peek.c:92: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 res[128]; data/genwqe-user-4.0.18/tools/genwqe_peek.c:94: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(res, "/sys/class/cxl/card%u/device/resource%u", data/genwqe-user-4.0.18/tools/genwqe_peek.c:97: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(res, O_RDWR); data/genwqe-user-4.0.18/tools/genwqe_poke.c:103: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 res[128]; data/genwqe-user-4.0.18/tools/genwqe_poke.c:105: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(res, "/sys/class/cxl/card%u/device/resource%u", data/genwqe-user-4.0.18/tools/genwqe_poke.c:108: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(res, O_RDWR); data/genwqe-user-4.0.18/tools/genwqe_update.c:43: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 sysfs_type[128] = "unknown"; data/genwqe-user-4.0.18/tools/genwqe_update.c:82: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 sysfs[128]; data/genwqe-user-4.0.18/tools/genwqe_update.c:88: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(sysfs, "r"); data/genwqe-user-4.0.18/tools/genwqe_update.c:332:16: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if ((env) && (atoi(env) > 0)) { data/genwqe-user-4.0.18/tools/genwqe_vpd_common.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 label[4]; data/genwqe-user-4.0.18/tools/genwqe_vpd_common.c:184: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[MAX_LINE]; data/genwqe-user-4.0.18/tools/genwqe_vpd_common.c:185: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 token[MAX_LINE]; data/genwqe-user-4.0.18/tools/genwqe_vpd_common.c:269:8: [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(&data[4], token, n); data/genwqe-user-4.0.18/tools/genwqe_vpd_common.c:344: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(&buffer[seek_offset], data, write_size); data/genwqe-user-4.0.18/tools/genwqe_vpdconv.c:155: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). ip = fopen(input_file, "r"); data/genwqe-user-4.0.18/tools/genwqe_vpdconv.c:163: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). op = fopen(output_file, "w"); data/genwqe-user-4.0.18/tools/genwqe_vpdupdate.c:209: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). fp_in = fopen(fname, "r"); data/genwqe-user-4.0.18/tools/genwqe_vpdupdate.c:223:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp_out = fopen(fname, "w"); data/genwqe-user-4.0.18/tools/genwqe_vpdupdate.c:238:16: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). if ((env) && (atoi(env) > 0)) { data/genwqe-user-4.0.18/tools/gzFile_test.c:183: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(fname, "r"); data/genwqe-user-4.0.18/tools/gzFile_test.c:210: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(fname, "w+"); data/genwqe-user-4.0.18/tools/gzFile_test.c:232: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 mode[16]; data/genwqe-user-4.0.18/tools/gzFile_test.c:239: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). ifp = fopen(i_fname, "r"); data/genwqe-user-4.0.18/tools/gzFile_test.c:251: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(mode, "wb%d", level); data/genwqe-user-4.0.18/tools/gzFile_test.c:310: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). ofp = fopen(o_fname, "w+"); data/genwqe-user-4.0.18/tools/gzFile_test.c:438:13: [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). card_no = atoi(card_no_env); data/genwqe-user-4.0.18/tools/zlib_mt_perf.c:107: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 i_fname[128], c_fname[128]; data/genwqe-user-4.0.18/tools/zlib_mt_perf.c:493: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). i_fp = fopen(i_fname, "r"); /* original data */ data/genwqe-user-4.0.18/tools/zlib_mt_perf.c:536: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). c_fp = fopen(c_fname, "r"); /* original data */ data/genwqe-user-4.0.18/lib/ddcb_capi.c:549:3: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100); data/genwqe-user-4.0.18/lib/ddcb_capi.c:1385:9: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. return memalign(sysconf(_SC_PAGESIZE), size); data/genwqe-user-4.0.18/lib/deflate.c:93: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). if (gz_h->name) name_len = strlen(gz_h->name); data/genwqe-user-4.0.18/lib/deflate.c:95: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). if (gz_h->comment) c_len = strlen(gz_h->comment); data/genwqe-user-4.0.18/lib/libcard.c:766:6: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(50000); data/genwqe-user-4.0.18/lib/libcard.c:816:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(ld->inotify_fd, buf, sizeof(buf)); data/genwqe-user-4.0.18/lib/libcard.c:1450:6: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(1000000);/* no fd in queue */ data/genwqe-user-4.0.18/lib/libcard.c:1518:9: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. buf = memalign(page_size, size); data/genwqe-user-4.0.18/lib/libcard.c:1726:8: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. buf = memalign(page_size, buflen); data/genwqe-user-4.0.18/lib/libcard.c:1826:8: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. buf = memalign(page_size, 2 * buflen); data/genwqe-user-4.0.18/lib/libcard.c:1842:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = (int)read(fd, (void *)(unsigned long)load.data_addr, data/genwqe-user-4.0.18/lib/libcard.c:1910:8: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. buf = memalign(page_size, buflen); data/genwqe-user-4.0.18/lib/libcard.c:1944:8: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. buf = memalign(page_size, buflen); data/genwqe-user-4.0.18/lib/libzHW.c:524:8: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. ptr = memalign(page_size, size); data/genwqe-user-4.0.18/lib/software.c:743: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). return strlen(s); data/genwqe-user-4.0.18/lib/software.c:767:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(fd, buf, count); data/genwqe-user-4.0.18/misc/zpipe_append.c:543: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). CHUNK_i = expected_bytes + strlen(pattern); data/genwqe-user-4.0.18/misc/zpipe_append.c:569: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). (int)strlen(pattern)); data/genwqe-user-4.0.18/tools/genwqe_cksum.c:359:12: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. ibuf4k = memalign(page_size, DATA_BUF_SIZE + pgoffs_i); data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:221: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). line[strlen(line) - 2] = '\0'; /* remove newline character */ data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:223:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). line_len = (int)strlen(line); data/genwqe-user-4.0.18/tools/genwqe_csv2vpd.c:240: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(token) != 0) { data/genwqe-user-4.0.18/tools/genwqe_echo.c:114: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). len = (int)strlen(tstring); data/genwqe-user-4.0.18/tools/genwqe_echo.c:118: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). (unsigned int)strlen(tstring)); data/genwqe-user-4.0.18/tools/genwqe_echo.c:130:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((char *)cmd->asiv, tstring, len); data/genwqe-user-4.0.18/tools/genwqe_echo.c:189: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). strlen(teststring)) != 0) { data/genwqe-user-4.0.18/tools/genwqe_echo.c:196: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). for (i = 0; i < strlen(teststring); i++) { data/genwqe-user-4.0.18/tools/genwqe_echo.c:329: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). if (strlen(teststring) > DDCB_ASV_LENGTH) { data/genwqe-user-4.0.18/tools/genwqe_echo.c:419:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). preload, (int)strlen(teststring), data/genwqe-user-4.0.18/tools/genwqe_echo.c:430:4: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(interval); data/genwqe-user-4.0.18/tools/genwqe_gzip.c:986: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). head.comm_max = strlen(comment) + 1; data/genwqe-user-4.0.18/tools/genwqe_gzip.c:990: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). head.name_max = strlen(name) + 1; data/genwqe-user-4.0.18/tools/genwqe_loadtree.c:176:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). line_len = (int)strlen(line); data/genwqe-user-4.0.18/tools/genwqe_maint.c:621:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(0); data/genwqe-user-4.0.18/tools/genwqe_memcopy.c:385:12: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. obuf4k = memalign(ip->page_size, data/genwqe-user-4.0.18/tools/genwqe_memcopy.c:605:16: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. pt->ibuf4k = memalign(ip->page_size, data/genwqe-user-4.0.18/tools/genwqe_peek.c:261:6: [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. if (equal && not_equal) { data/genwqe-user-4.0.18/tools/genwqe_peek.c:311:8: [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. if ((equal) && data/genwqe-user-4.0.18/tools/genwqe_peek.c:328:4: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(interval); data/genwqe-user-4.0.18/tools/genwqe_poke.c:343:4: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(interval); data/genwqe-user-4.0.18/tools/genwqe_update.c:99: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). sysfs_type[strlen(sysfs_type)-1] = 0; /* remove trailing '\n' */ data/genwqe-user-4.0.18/tools/genwqe_vpd_common.c:216: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). line[strlen(line) - 2] = '\0'; /* remove newline character */ data/genwqe-user-4.0.18/tools/genwqe_vpd_common.c:218:19: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). line_len = (int)strlen(line); data/genwqe-user-4.0.18/tools/genwqe_vpd_common.c:229: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). n = strlen(&token[0]); data/genwqe-user-4.0.18/tools/genwqe_vpd_common.c:257: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). if (1 == strlen(&token[0])) { data/genwqe-user-4.0.18/tools/genwqe_vpd_common.c:266: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). n = strlen(&token[0]); ANALYSIS SUMMARY: Hits = 279 Lines analyzed = 25493 in approximately 0.69 seconds (37095 lines/second) Physical Source Lines of Code (SLOC) = 17497 Hits@level = [0] 349 [1] 46 [2] 128 [3] 45 [4] 54 [5] 6 Hits@level+ = [0+] 628 [1+] 279 [2+] 233 [3+] 105 [4+] 60 [5+] 6 Hits/KSLOC@level+ = [0+] 35.8919 [1+] 15.9456 [2+] 13.3166 [3+] 6.00103 [4+] 3.42916 [5+] 0.342916 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.