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/firmware-nonfree-20200918/carl9170fw/carlfw/include/cam.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/carl9170.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/cmd.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/config.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/dma.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/fwdsc.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/gpio.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/hostif.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/io.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/printf.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/rf.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/rom.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/timer.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/uart.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/usb.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/usb_fifo.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/wl.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/include/wol.h Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/src/cam.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/src/cmd.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/src/dma.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/src/fw.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/src/gpio.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/src/hostif.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/src/main.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/src/printf.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/src/rf.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/src/uart.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/src/wlan.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/src/wol.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/usb/fifo.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/usb/main.c Examining data/firmware-nonfree-20200918/carl9170fw/carlfw/usb/usb.c Examining data/firmware-nonfree-20200918/carl9170fw/config/conf.c Examining data/firmware-nonfree-20200918/carl9170fw/config/confdata.c Examining data/firmware-nonfree-20200918/carl9170fw/config/expr.c Examining data/firmware-nonfree-20200918/carl9170fw/config/expr.h Examining data/firmware-nonfree-20200918/carl9170fw/config/lkc.h Examining data/firmware-nonfree-20200918/carl9170fw/config/lkc_proto.h Examining data/firmware-nonfree-20200918/carl9170fw/config/menu.c Examining data/firmware-nonfree-20200918/carl9170fw/config/symbol.c Examining data/firmware-nonfree-20200918/carl9170fw/config/util.c Examining data/firmware-nonfree-20200918/carl9170fw/include/linux/ch9.h Examining data/firmware-nonfree-20200918/carl9170fw/include/linux/compiler.h Examining data/firmware-nonfree-20200918/carl9170fw/include/linux/ieee80211.h Examining data/firmware-nonfree-20200918/carl9170fw/include/linux/types.h Examining data/firmware-nonfree-20200918/carl9170fw/include/shared/eeprom.h Examining data/firmware-nonfree-20200918/carl9170fw/include/shared/fwcmd.h Examining data/firmware-nonfree-20200918/carl9170fw/include/shared/fwdesc.h Examining data/firmware-nonfree-20200918/carl9170fw/include/shared/hw.h Examining data/firmware-nonfree-20200918/carl9170fw/include/shared/phy.h Examining data/firmware-nonfree-20200918/carl9170fw/include/shared/version.h Examining data/firmware-nonfree-20200918/carl9170fw/include/shared/wlan.h Examining data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/carlu.h Examining data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/cmd.c Examining data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/cmd.h Examining data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/debug.c Examining data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/debug.h Examining data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/fw.c Examining data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/main.c Examining data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/rx.c Examining data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/test.c Examining data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/test.h Examining data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/tx.c Examining data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/usb.c Examining data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/usb.h Examining data/firmware-nonfree-20200918/carl9170fw/tools/include/frame.h Examining data/firmware-nonfree-20200918/carl9170fw/tools/include/list.h Examining data/firmware-nonfree-20200918/carl9170fw/tools/lib/carlfw.c Examining data/firmware-nonfree-20200918/carl9170fw/tools/lib/carlfw.h Examining data/firmware-nonfree-20200918/carl9170fw/tools/src/checksum.c Examining data/firmware-nonfree-20200918/carl9170fw/tools/src/eeprom_fix.c Examining data/firmware-nonfree-20200918/carl9170fw/tools/src/fwinfo.c Examining data/firmware-nonfree-20200918/carl9170fw/tools/src/miniboot.c Examining data/firmware-nonfree-20200918/carl9170fw/tools/src/wol.c Examining data/firmware-nonfree-20200918/isci/create_fw.c Examining data/firmware-nonfree-20200918/isci/create_fw.h Examining data/firmware-nonfree-20200918/isci/probe_roms.h FINAL RESULTS: data/firmware-nonfree-20200918/carl9170fw/carlfw/include/printf.h:37:29: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void __attribute__((format (printf, 1, 2))) tfp_printf(const char *fmt, ...); data/firmware-nonfree-20200918/carl9170fw/carlfw/include/printf.h:39:9: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define printf tfp_printf data/firmware-nonfree-20200918/carl9170fw/carlfw/include/printf.h:42:29: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void __attribute__((format (printf, 1, 2))) min_printf(const char *fmt, ...); data/firmware-nonfree-20200918/carl9170fw/carlfw/include/printf.h:44:9: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define printf min_printf data/firmware-nonfree-20200918/carl9170fw/carlfw/include/printf.h:49:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(fmt, ## args); \ data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:20:26: [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. __attribute__ ((format (printf, 1, 2))); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:23:26: [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. __attribute__ ((format (printf, 1, 2))); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:35:2: [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, fmt, ap); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:44:2: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, ap); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:96: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(res_value, sym_get_string_value(sym)); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:99: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(res_value, in); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:113:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fullname, "%s/%s", env, name); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:735: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(dirname, name); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:751:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(newname, "%s%s", dirname, basename); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:754:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid()); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:805: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(dirname, basename); data/firmware-nonfree-20200918/carl9170fw/config/menu.c:26:2: [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, fmt, ap); data/firmware-nonfree-20200918/carl9170fw/config/menu.c:36:2: [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, fmt, ap); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:667: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(val, newval); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:895: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(res, symval); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:898: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(res, in); data/firmware-nonfree-20200918/carl9170fw/config/util.c:120: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(gs->s, s); data/firmware-nonfree-20200918/carl9170fw/config/util.c:130:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(s, sizeof(s), fmt, ap); data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/debug.h:46:5: [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(dbg_lvl_to_fh(lvl), "<%d>:" fmt, lvl, ##args); \ data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/debug.h:48:5: [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(dbg_lvl_to_fh(lvl), fmt, ##args); \ data/firmware-nonfree-20200918/carl9170fw/tools/src/wol.c:154:10: [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. err = sscanf(optarg, MAC_STR, MAC_ARG(mac)) != 6; data/firmware-nonfree-20200918/carl9170fw/config/conf.c:485:16: [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 ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) { data/firmware-nonfree-20200918/carl9170fw/config/conf.c:504:4: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(seed); data/firmware-nonfree-20200918/carl9170fw/config/conf.c:554: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. name = getenv("KCONFIG_ALLCONFIG"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:66: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 *name = getenv("KCONFIG_CONFIG"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:73: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 *name = getenv("KCONFIG_AUTOCONFIG"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:111: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(SRCTREE); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:752: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("KCONFIG_OVERWRITECONFIG"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:996: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. name = getenv("KCONFIG_AUTOHEADER"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:1001: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. name = getenv("KCONFIG_TRISTATE"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:1006: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. name = getenv("KCONFIG_CMAKE"); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:1305:6: [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. p = getenv(env); data/firmware-nonfree-20200918/carl9170fw/config/util.c:65: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. value = getenv(env_sym->name); data/firmware-nonfree-20200918/carl9170fw/tools/src/wol.c:146:16: [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 ((opt = getopt(argc, args, "m:i:n:v")) != -EXIT_FAILURE) { data/firmware-nonfree-20200918/carl9170fw/carlfw/src/cmd.c:59: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(resp->echo.vals, cmd->echo.vals, cmd->hdr.len); data/firmware-nonfree-20200918/carl9170fw/carlfw/src/cmd.c:96: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(&resp->tally, &fw.tally, sizeof(struct carl9170_tally_rsp)); data/firmware-nonfree-20200918/carl9170fw/carlfw/src/dma.c:35: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(dst, src, sizeof(struct dma_desc)); data/firmware-nonfree-20200918/carl9170fw/carlfw/src/printf.c:24: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 buf[12]; data/firmware-nonfree-20200918/carl9170fw/carlfw/src/wlan.c:579: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(ba->ra, ctx->ta, 6); data/firmware-nonfree-20200918/carl9170fw/carlfw/src/wlan.c:580: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(ba->ta, ctx->ra, 6); data/firmware-nonfree-20200918/carl9170fw/carlfw/src/wlan.c:645: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(ctx->ra, bar->ra, 6); data/firmware-nonfree-20200918/carl9170fw/carlfw/src/wlan.c:646: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(ctx->ta, bar->ta, 6); data/firmware-nonfree-20200918/carl9170fw/carlfw/src/wol.c:36: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(&fw.wol.cmd, cmd, sizeof(cmd)); data/firmware-nonfree-20200918/carl9170fw/carlfw/src/wol.c:42: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((void *)AR9170_MAC_REG_MAC_ADDR_L, fw.wol.cmd.mac, 6); data/firmware-nonfree-20200918/carl9170fw/carlfw/src/wol.c:43: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((void *)AR9170_MAC_REG_BSSID_L, fw.wol.cmd.bssid, 6); data/firmware-nonfree-20200918/carl9170fw/carlfw/src/wol.c:161: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(null->addr1, fw.wol.cmd.bssid, 6); data/firmware-nonfree-20200918/carl9170fw/carlfw/src/wol.c:162: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(null->addr2, fw.wol.cmd.mac, 6); data/firmware-nonfree-20200918/carl9170fw/carlfw/src/wol.c:163: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(null->addr3, fw.wol.cmd.bssid, 6); data/firmware-nonfree-20200918/carl9170fw/carlfw/usb/main.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(DESC_PAYLOAD_OFF(fw.usb.int_desc, tlen), rsp, elen); data/firmware-nonfree-20200918/carl9170fw/carlfw/usb/main.c:210: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(resp->data, body, len); data/firmware-nonfree-20200918/carl9170fw/carlfw/usb/usb.c:286: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(GET_ARRAY(data, offset), &value, data/firmware-nonfree-20200918/carl9170fw/carlfw/usb/usb.c:306: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(&value, GET_ARRAY(data, offset), block); data/firmware-nonfree-20200918/carl9170fw/config/conf.c:40: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 line[128]; data/firmware-nonfree-20200918/carl9170fw/config/conf.c:315:11: [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). cnt = atoi(line); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:82: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 res_value[SYMBOL_MAXLENGTH]; data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:83: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 *dst, name[SYMBOL_MAXLENGTH]; data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:107: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 fullname[PATH_MAX+1]; data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:188: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[1024]; data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:631: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[256]; data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:652: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). out = fopen(filename, "w"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:726: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 dirname[PATH_MAX+1], tmpname[PATH_MAX+1], newname[PATH_MAX+1]; data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:740: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(dirname, name, size); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:755: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). out = fopen(tmpname, "w"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:758: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). out = fopen(newname, "w"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:806: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(dirname, ".old"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:822:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX+1]; data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:893: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(d, ".h"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:896:8: [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(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:916: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). fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:945: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). out = fopen(".tmpconfig", "w"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:949: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). tristate = fopen(".tmpconfig_tristate", "w"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:955: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). out_h = fopen(".tmpconfig.h", "w"); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:962: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). out_c = fopen(".tmpconfig.cmake", "w"); data/firmware-nonfree-20200918/carl9170fw/config/expr.c:70: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, org, sizeof(*org)); data/firmware-nonfree-20200918/carl9170fw/config/expr.c:1115: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 buf[32]; data/firmware-nonfree-20200918/carl9170fw/config/expr.c:1116: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(buf, "<unknown type %d>", e->type); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:159: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[64]; data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:182: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(str, "%d", val2); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:184: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(str, "0x%x", val2); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:870: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 *p, name[SYMBOL_MAXLENGTH]; data/firmware-nonfree-20200918/carl9170fw/config/util.c:44: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). out = fopen("..config.tmp", "w"); data/firmware-nonfree-20200918/carl9170fw/config/util.c:128: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[10000]; /* big enough... */ data/firmware-nonfree-20200918/carl9170fw/include/shared/fwdesc.h:142: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[CARL9170FW_MOTD_STRING_LEN]; data/firmware-nonfree-20200918/carl9170fw/include/shared/fwdesc.h:143: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 release[CARL9170FW_MOTD_RELEASE_LEN]; data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/carlu.h:50: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 irq_buf[AR9170_RX_BULK_IRQ_SIZE]; data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/carlu.h:53: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 buf[CARL9170_MAX_CMD_LEN]; data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/debug.c:72: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[58]; data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/debug.c:73: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[17] = { 0 }; data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/debug.c:85:12: [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. pbuf += sprintf(pbuf, "0x%04lx: ", (unsigned long)i); data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/debug.c:88:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. pbuf += sprintf(pbuf, "%.2x ", tmp[i]); data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/debug.c:96:13: [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. pbuf += sprintf(pbuf, " "); data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/main.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 help_text[80]; data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/main.c:272: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 parameters[ARRAY_SIZE(menu) + 1]; data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/rx.c:66: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(ar->resp_buf, buf + 4, len - 4); data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/usb.c:664: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(&ar->cmd.cmd.data, cmd, clen); data/firmware-nonfree-20200918/carl9170fw/tools/lib/carlfw.c:56: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 text[0]; data/firmware-nonfree-20200918/carl9170fw/tools/lib/carlfw.c:119: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(tmp->data, desc, len); data/firmware-nonfree-20200918/carl9170fw/tools/lib/carlfw.c:158: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). fh = fopen(name, mode); data/firmware-nonfree-20200918/carl9170fw/tools/lib/carlfw.c:398: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 filename[256]; data/firmware-nonfree-20200918/carl9170fw/tools/lib/carlfw.c:531: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). fh = fopen(fw->fw.name, "w"); data/firmware-nonfree-20200918/carl9170fw/tools/lib/carlfw.c:544: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). fh = fopen(fw->hdr.name, "w"); data/firmware-nonfree-20200918/carl9170fw/tools/src/eeprom_fix.c:73: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(&fix->data[0], fix_entry, sizeof(*fix_entry)); data/firmware-nonfree-20200918/carl9170fw/tools/src/eeprom_fix.c:107: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(&fix->data[entry], fix_entry, sizeof(*fix_entry)); data/firmware-nonfree-20200918/carl9170fw/tools/src/fwinfo.c:35:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[64]; data/firmware-nonfree-20200918/carl9170fw/tools/src/fwinfo.c:123: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[CARL9170FW_MOTD_STRING_LEN]; data/firmware-nonfree-20200918/carl9170fw/tools/src/miniboot.c:56:6: [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). m = fopen(mini, "r"); data/firmware-nonfree-20200918/carl9170fw/tools/src/wol.c:100:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char wol_magic_tmpl[30 + 6 + 16 * 6] = { data/firmware-nonfree-20200918/carl9170fw/tools/src/wol.c:115: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(&wol_magic[30 + i * 6], mac, 6); data/firmware-nonfree-20200918/carl9170fw/tools/src/wol.c:142: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 mac[ETH_ALEN]; data/firmware-nonfree-20200918/carl9170fw/tools/src/wol.c:143: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 dev_name[IFNAMSIZ + 1] = { 0 }; data/firmware-nonfree-20200918/isci/create_fw.c:21: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). fd = fopen(blob_name, "w+"); data/firmware-nonfree-20200918/carl9170fw/carlfw/include/io.h:81:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). uint32_t i = 0, read, tmp; data/firmware-nonfree-20200918/carl9170fw/carlfw/include/io.h:85:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). tmp = read; data/firmware-nonfree-20200918/carl9170fw/carlfw/include/io.h:88:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). } while (tmp != read && i <= 10); data/firmware-nonfree-20200918/carl9170fw/carlfw/include/io.h:90:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read; data/firmware-nonfree-20200918/carl9170fw/config/conf.c:60:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = strlen(p); data/firmware-nonfree-20200918/carl9170fw/config/conf.c:151: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/firmware-nonfree-20200918/carl9170fw/config/conf.c:332:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (line[0] && line[strlen(line) - 1] == '?') { data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:88: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(res_value, in, src - in); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:161: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). memmove(p2, p2 + 1, strlen(p2)); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:254:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (memcmp(line + 2, CONFIG_, strlen(CONFIG_))) data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:256: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). p = strchr(line + 2 + strlen(CONFIG_), ' '); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:263: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). sym = sym_find(line + 2 + strlen(CONFIG_)); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:269:33: [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). sym = sym_lookup(line + 2 + strlen(CONFIG_), 0); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:285: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). } else if (memcmp(line, CONFIG_, strlen(CONFIG_)) == 0) { data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:286: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). p = strchr(line + strlen(CONFIG_), '='); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:297:27: [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). sym = sym_find(line + strlen(CONFIG_)); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:303: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). sym = sym_lookup(line + strlen(CONFIG_), 0); data/firmware-nonfree-20200918/carl9170fw/config/confdata.c:736:4: [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(dirname, "/"); data/firmware-nonfree-20200918/carl9170fw/config/expr.c:1127: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). xfwrite(str, strlen(str), 1, data); data/firmware-nonfree-20200918/carl9170fw/config/expr.c:1144:27: [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 extra_length = strlen(str); data/firmware-nonfree-20200918/carl9170fw/config/expr.c:1149: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). extra_length += 4 + strlen(sym_str); data/firmware-nonfree-20200918/carl9170fw/config/expr.c:1154: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). last_line_length = strlen(gs->s) - (last_cr - gs->s); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:656: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). size = strlen(newval) + 1; data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:865: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). reslen = strlen(in) + 1; data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:875: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(res, in, src - in); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:889: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). newlen = strlen(res) + strlen(symval) + strlen(src) + 1; data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:889: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). newlen = strlen(res) + strlen(symval) + strlen(src) + 1; data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:889:43: [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). newlen = strlen(res) + strlen(symval) + strlen(src) + 1; data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:910: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). reslen = strlen(in) + strlen("\"\"") + 1; data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:910: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). reslen = strlen(in) + strlen("\"\"") + 1; data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:927:2: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(res, "\""); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:932: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(res, p, l); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:938:3: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(res, "\\"); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:939: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(res, p++, 1); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:942:2: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(res, "\""); data/firmware-nonfree-20200918/carl9170fw/config/symbol.c:954:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(pattern) == 0) data/firmware-nonfree-20200918/carl9170fw/config/util.c:87:2: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(gs.s, "\0"); data/firmware-nonfree-20200918/carl9170fw/config/util.c:96: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). gs.len = strlen(s) + 1; data/firmware-nonfree-20200918/carl9170fw/config/util.c:115: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). l = strlen(gs->s) + strlen(s) + 1; data/firmware-nonfree-20200918/carl9170fw/config/util.c:115:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = strlen(gs->s) + strlen(s) + 1; data/firmware-nonfree-20200918/carl9170fw/tools/carlu/src/main.c:303: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). if (argc != 2 || strlen(argv[1]) != 2 || argv[1][0] != '-') data/firmware-nonfree-20200918/carl9170fw/tools/src/fwinfo.c:131:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, motd->desc, CARL9170FW_MOTD_STRING_LEN); data/firmware-nonfree-20200918/carl9170fw/tools/src/fwinfo.c:134:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, motd->release, CARL9170FW_MOTD_STRING_LEN); data/firmware-nonfree-20200918/carl9170fw/tools/src/wol.c:150:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dev_name, optarg, IFNAMSIZ); data/firmware-nonfree-20200918/isci/create_fw.c:45:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(isci_orom->hdr.signature, sig, strlen(sig)); data/firmware-nonfree-20200918/isci/create_fw.c:45:41: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncpy(isci_orom->hdr.signature, sig, strlen(sig)); ANALYSIS SUMMARY: Hits = 162 Lines analyzed = 23254 in approximately 0.91 seconds (25491 lines/second) Physical Source Lines of Code (SLOC) = 16001 Hits@level = [0] 225 [1] 46 [2] 77 [3] 13 [4] 26 [5] 0 Hits@level+ = [0+] 387 [1+] 162 [2+] 116 [3+] 39 [4+] 26 [5+] 0 Hits/KSLOC@level+ = [0+] 24.186 [1+] 10.1244 [2+] 7.24955 [3+] 2.43735 [4+] 1.6249 [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.