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/swupdate-2020.04/bindings/auxiliar.c Examining data/swupdate-2020.04/bindings/auxiliar.h Examining data/swupdate-2020.04/bindings/lua_compat_shared.c Examining data/swupdate-2020.04/bindings/lua_swupdate.c Examining data/swupdate-2020.04/bootloader/ebg.c Examining data/swupdate-2020.04/bootloader/grub.c Examining data/swupdate-2020.04/bootloader/grub.h Examining data/swupdate-2020.04/bootloader/none.c Examining data/swupdate-2020.04/bootloader/uboot.c Examining data/swupdate-2020.04/bootloader/uboot.h Examining data/swupdate-2020.04/core/artifacts_versions.c Examining data/swupdate-2020.04/core/cpio_utils.c Examining data/swupdate-2020.04/core/handler.c Examining data/swupdate-2020.04/core/installer.c Examining data/swupdate-2020.04/core/network_thread.c Examining data/swupdate-2020.04/core/notifier.c Examining data/swupdate-2020.04/core/parser.c Examining data/swupdate-2020.04/core/parsing_library.c Examining data/swupdate-2020.04/core/pctl.c Examining data/swupdate-2020.04/core/progress_thread.c Examining data/swupdate-2020.04/core/state.c Examining data/swupdate-2020.04/core/stream_interface.c Examining data/swupdate-2020.04/core/swupdate.c Examining data/swupdate-2020.04/core/swupdate_dict.c Examining data/swupdate-2020.04/core/syslog.c Examining data/swupdate-2020.04/core/util.c Examining data/swupdate-2020.04/corelib/channel_curl.c Examining data/swupdate-2020.04/corelib/downloader.c Examining data/swupdate-2020.04/corelib/lua_compat.c Examining data/swupdate-2020.04/corelib/lua_interface.c Examining data/swupdate-2020.04/corelib/mtd-interface.c Examining data/swupdate-2020.04/corelib/parsing_library_libconfig.c Examining data/swupdate-2020.04/corelib/parsing_library_libjson.c Examining data/swupdate-2020.04/corelib/swupdate_cms_verify.c Examining data/swupdate-2020.04/corelib/swupdate_decrypt.c Examining data/swupdate-2020.04/corelib/swupdate_decrypt_mbedtls.c Examining data/swupdate-2020.04/corelib/swupdate_rsa_verify.c Examining data/swupdate-2020.04/corelib/swupdate_rsa_verify_mbedtls.c Examining data/swupdate-2020.04/corelib/swupdate_settings.c Examining data/swupdate-2020.04/corelib/swupdate_verify_private.h Examining data/swupdate-2020.04/corelib/verify_signature.c Examining data/swupdate-2020.04/corelib/verify_signature_mbedtls.c Examining data/swupdate-2020.04/handlers/archive_handler.c Examining data/swupdate-2020.04/handlers/boot_handler.c Examining data/swupdate-2020.04/handlers/diskpart_handler.c Examining data/swupdate-2020.04/handlers/dummy_handler.c Examining data/swupdate-2020.04/handlers/flash_hamming1_handler.c Examining data/swupdate-2020.04/handlers/flash_handler.c Examining data/swupdate-2020.04/handlers/lua_scripthandler.c Examining data/swupdate-2020.04/handlers/raw_handler.c Examining data/swupdate-2020.04/handlers/rdiff_handler.c Examining data/swupdate-2020.04/handlers/readback_handler.c Examining data/swupdate-2020.04/handlers/remote_handler.c Examining data/swupdate-2020.04/handlers/shell_scripthandler.c Examining data/swupdate-2020.04/handlers/ssbl_handler.c Examining data/swupdate-2020.04/handlers/swuforward-ws.c Examining data/swupdate-2020.04/handlers/swuforward_handler.c Examining data/swupdate-2020.04/handlers/swuforward_handler.h Examining data/swupdate-2020.04/handlers/ubivol_handler.c Examining data/swupdate-2020.04/handlers/ucfw_handler.c Examining data/swupdate-2020.04/include/bootloader.h Examining data/swupdate-2020.04/include/bsdqueue.h Examining data/swupdate-2020.04/include/channel.h Examining data/swupdate-2020.04/include/channel_curl.h Examining data/swupdate-2020.04/include/channel_op_res.h Examining data/swupdate-2020.04/include/compat.h Examining data/swupdate-2020.04/include/cpiohdr.h Examining data/swupdate-2020.04/include/download_interface.h Examining data/swupdate-2020.04/include/globals.h Examining data/swupdate-2020.04/include/handler.h Examining data/swupdate-2020.04/include/installer.h Examining data/swupdate-2020.04/include/lua_util.h Examining data/swupdate-2020.04/include/mongoose_interface.h Examining data/swupdate-2020.04/include/network_interface.h Examining data/swupdate-2020.04/include/network_ipc.h Examining data/swupdate-2020.04/include/parselib.h Examining data/swupdate-2020.04/include/parsers.h Examining data/swupdate-2020.04/include/pctl.h Examining data/swupdate-2020.04/include/progress.h Examining data/swupdate-2020.04/include/progress_ipc.h Examining data/swupdate-2020.04/include/sslapi.h Examining data/swupdate-2020.04/include/state.h Examining data/swupdate-2020.04/include/suricatta/server.h Examining data/swupdate-2020.04/include/suricatta/suricatta.h Examining data/swupdate-2020.04/include/swupdate.h Examining data/swupdate-2020.04/include/swupdate_dict.h Examining data/swupdate-2020.04/include/swupdate_settings.h Examining data/swupdate-2020.04/include/swupdate_status.h Examining data/swupdate-2020.04/include/util.h Examining data/swupdate-2020.04/include/flash.h Examining data/swupdate-2020.04/ipc/network_ipc-if.c Examining data/swupdate-2020.04/ipc/network_ipc.c Examining data/swupdate-2020.04/ipc/progress_ipc.c Examining data/swupdate-2020.04/mongoose/mongoose.c Examining data/swupdate-2020.04/mongoose/mongoose.h Examining data/swupdate-2020.04/mongoose/mongoose_interface.c Examining data/swupdate-2020.04/parser/parse_external.c Examining data/swupdate-2020.04/parser/parser.c Examining data/swupdate-2020.04/scripts/basic/fixdep.c Examining data/swupdate-2020.04/scripts/kconfig/conf.c Examining data/swupdate-2020.04/scripts/kconfig/confdata.c Examining data/swupdate-2020.04/scripts/kconfig/expr.c Examining data/swupdate-2020.04/scripts/kconfig/expr.h Examining data/swupdate-2020.04/scripts/kconfig/gconf.c Examining data/swupdate-2020.04/scripts/kconfig/images.c Examining data/swupdate-2020.04/scripts/kconfig/kxgettext.c Examining data/swupdate-2020.04/scripts/kconfig/list.h Examining data/swupdate-2020.04/scripts/kconfig/lkc.h Examining data/swupdate-2020.04/scripts/kconfig/lkc_defs.h Examining data/swupdate-2020.04/scripts/kconfig/lkc_proto.h Examining data/swupdate-2020.04/scripts/kconfig/lxdialog/checklist.c Examining data/swupdate-2020.04/scripts/kconfig/lxdialog/dialog.h Examining data/swupdate-2020.04/scripts/kconfig/lxdialog/inputbox.c Examining data/swupdate-2020.04/scripts/kconfig/lxdialog/menubox.c Examining data/swupdate-2020.04/scripts/kconfig/lxdialog/textbox.c Examining data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c Examining data/swupdate-2020.04/scripts/kconfig/lxdialog/yesno.c Examining data/swupdate-2020.04/scripts/kconfig/mconf.c Examining data/swupdate-2020.04/scripts/kconfig/menu.c Examining data/swupdate-2020.04/scripts/kconfig/nconf.c Examining data/swupdate-2020.04/scripts/kconfig/nconf.gui.c Examining data/swupdate-2020.04/scripts/kconfig/nconf.h Examining data/swupdate-2020.04/scripts/kconfig/qconf.cc Examining data/swupdate-2020.04/scripts/kconfig/qconf.h Examining data/swupdate-2020.04/scripts/kconfig/symbol.c Examining data/swupdate-2020.04/scripts/kconfig/util.c Examining data/swupdate-2020.04/suricatta/common.c Examining data/swupdate-2020.04/suricatta/server_general.c Examining data/swupdate-2020.04/suricatta/server_general.h Examining data/swupdate-2020.04/suricatta/server_hawkbit.c Examining data/swupdate-2020.04/suricatta/server_hawkbit.h Examining data/swupdate-2020.04/suricatta/suricatta.c Examining data/swupdate-2020.04/suricatta/suricatta_private.h Examining data/swupdate-2020.04/test/test_crypt.c Examining data/swupdate-2020.04/test/test_hash.c Examining data/swupdate-2020.04/test/test_json.c Examining data/swupdate-2020.04/test/test_server_hawkbit.c Examining data/swupdate-2020.04/test/test_verify.c Examining data/swupdate-2020.04/tools/swupdate-client.c Examining data/swupdate-2020.04/tools/swupdate-hawkbitcfg.c Examining data/swupdate-2020.04/tools/swupdate-progress.c Examining data/swupdate-2020.04/tools/swupdate-sendtohawkbit.c Examining data/swupdate-2020.04/tools/swupdate-sysrestart.c FINAL RESULTS: data/swupdate-2020.04/core/network_thread.c:139:7: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod(path, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) < 0) data/swupdate-2020.04/handlers/shell_scripthandler.c:38:6: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod(shellscript, S_IRUSR | S_IWUSR | S_IXUSR)) { data/swupdate-2020.04/core/cpio_utils.c:701: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(output_file, fdh.filename); data/swupdate-2020.04/core/installer.c:373:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bootscript, "%s%s", TMPDIR, BOOT_SCRIPT_SUFFIX); data/swupdate-2020.04/core/notifier.c:260: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(&addr->sun_path[1], path); data/swupdate-2020.04/core/parser.c:237: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(sigfile, descfile); data/swupdate-2020.04/core/pctl.c:160:7: [4] (shell) execvp: 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. if (execvp(cmdline, av) == -1) { data/swupdate-2020.04/core/pctl.c:259:9: [4] (shell) execl: 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. ret = execl("/bin/sh", "sh", "-c", cmd, (char *)NULL); data/swupdate-2020.04/core/swupdate.c:332:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(swdescfilename, "%s%s", get_tmpdir(), SW_DESCRIPTION_FILENAME); data/swupdate-2020.04/core/util.c:45:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(p, str); data/swupdate-2020.04/corelib/channel_curl.c:1030:4: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(channel_data->sha1hash, sha1hexchar); data/swupdate-2020.04/corelib/parsing_library_libjson.c:118:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(dest, json_object_get_string(e)); data/swupdate-2020.04/handlers/raw_handler.c:70:6: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(sysfs_path, W_OK) == -1) { data/swupdate-2020.04/handlers/raw_handler.c:200:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(DATADST_DIR, "%s%s", get_tmpdir(), DATADST_DIR_SUFFIX); data/swupdate-2020.04/handlers/rdiff_handler.c:285:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(mountpoint, "%s%s", get_tmpdir(), DATADST_DIR_SUFFIX); data/swupdate-2020.04/handlers/rdiff_handler.c:295:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(base_file_filename, "%s%s", mountpoint, img->path); data/swupdate-2020.04/handlers/swuforward_handler.c:193:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(posturl, "%s%s", conn->url, POST_URL_V2); data/swupdate-2020.04/handlers/ubivol_handler.c:120: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(rnvol.ents[0].name, vol2->name); data/swupdate-2020.04/handlers/ubivol_handler.c:124: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(rnvol.ents[1].name, vol1->name); data/swupdate-2020.04/include/util.h:93:5: [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(tmpbuf, sizeof(tmpbuf), \ data/swupdate-2020.04/include/util.h:100:5: [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(tmpbuf, sizeof(tmpbuf), \ data/swupdate-2020.04/include/util.h:104:4: [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(tmpbuf, sizeof(tmpbuf), \ data/swupdate-2020.04/mongoose/mongoose.c:643:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(cs_log_file, fmt, ap); data/swupdate-2020.04/mongoose/mongoose.c:1707:10: [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. return vsnprintf(buf, buf_size, fmt, ap); data/swupdate-2020.04/mongoose/mongoose.c:1954:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(ret, src); data/swupdate-2020.04/mongoose/mongoose.c:2047:9: [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. len = vsnprintf(*buf, size, fmt, ap_copy); data/swupdate-2020.04/mongoose/mongoose.c:2066:13: [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. len = vsnprintf(*buf, size - 1, fmt, ap_copy); data/swupdate-2020.04/mongoose/mongoose.c:2082:13: [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. len = vsnprintf(*buf, len + 1, fmt, ap_copy); data/swupdate-2020.04/mongoose/mongoose.c:7114:12: [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. result = sscanf(p, "bytes=%" INT64_FMT "-%" INT64_FMT, a, b); data/swupdate-2020.04/mongoose/mongoose.c:7450:7: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. if (sscanf(buf, fmt, user, pass) == 0) { data/swupdate-2020.04/mongoose/mongoose.c:7625:9: [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(buf, "%[^:]:%[^:]:%s", f_user, f_domain, f_ha1) == 3 && data/swupdate-2020.04/mongoose/mongoose.c:9001:7: [4] (shell) execle: 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. execle(cmd, cmd, (char *) 0, envp); /* (char *) 0 to squash warning */ data/swupdate-2020.04/mongoose/mongoose.c:9003:7: [4] (shell) execle: 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. execle(interp, interp, cmd, (char *) 0, envp); data/swupdate-2020.04/mongoose/mongoose.c:9032:9: [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. n = vsnprintf(added, (size_t) space, fmt, ap); data/swupdate-2020.04/mongoose/mongoose.c:9379:20: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. } else if ((fp = popen(cmd, "r")) == NULL) { data/swupdate-2020.04/mongoose/mongoose.c:11935:26: [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. for (p = line + len; sscanf(p, "%s%n", alias, &len) == 1; p += len) { data/swupdate-2020.04/mongoose/mongoose.c:13189:9: [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. len = vsnprintf(*strp, BUFSIZ, fmt, ap); data/swupdate-2020.04/mongoose/mongoose.c:13199:11: [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. len = vsnprintf(*strp, len + 1, fmt, ap); data/swupdate-2020.04/mongoose/mongoose.h:143:49: [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_LIKE(f, a) __attribute__((format(printf, f, a))) data/swupdate-2020.04/mongoose/mongoose.h:254:9: [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. #define snprintf _snprintf data/swupdate-2020.04/mongoose/mongoose.h:254:18: [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. #define snprintf _snprintf data/swupdate-2020.04/mongoose/mongoose.h:255:9: [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. #define vsnprintf _vsnprintf data/swupdate-2020.04/mongoose/mongoose.h:258:9: [4] (shell) popen: 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. #define popen(x, y) _popen((x), (y)) data/swupdate-2020.04/mongoose/mongoose.h:1612:9: [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. #define snprintf _snprintf data/swupdate-2020.04/mongoose/mongoose.h:1612:18: [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. #define snprintf _snprintf data/swupdate-2020.04/mongoose/mongoose.h:1614:9: [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. #define vsnprintf _vsnprintf data/swupdate-2020.04/mongoose/mongoose.h:4390:23: [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, 2, 3))) data/swupdate-2020.04/scripts/kconfig/confdata.c:25: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/swupdate-2020.04/scripts/kconfig/confdata.c:28: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/swupdate-2020.04/scripts/kconfig/confdata.c:40: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/swupdate-2020.04/scripts/kconfig/confdata.c:49: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/swupdate-2020.04/scripts/kconfig/confdata.c:102: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/swupdate-2020.04/scripts/kconfig/confdata.c:105: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/swupdate-2020.04/scripts/kconfig/confdata.c:119: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/swupdate-2020.04/scripts/kconfig/confdata.c:757: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/swupdate-2020.04/scripts/kconfig/confdata.c:773: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/swupdate-2020.04/scripts/kconfig/confdata.c:776: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/swupdate-2020.04/scripts/kconfig/confdata.c:827: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/swupdate-2020.04/scripts/kconfig/lxdialog/inputbox.c:56:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(instr, init); data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:388: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(tempstr, prompt); data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:619: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(item_cur->node.str, sizeof(item_cur->node.str), fmt, ap); data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:631: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(item_cur->node.str + strlen(item_cur->node.str), data/swupdate-2020.04/scripts/kconfig/mconf.c:780: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(buf, sizeof(buf), fmt, ap); data/swupdate-2020.04/scripts/kconfig/mconf.c:1034: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, N_("Your display is too small to run Menuconfig!\n")); data/swupdate-2020.04/scripts/kconfig/mconf.c:1035: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, N_("It must be at least 19 lines by 80 columns.\n")); data/swupdate-2020.04/scripts/kconfig/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/swupdate-2020.04/scripts/kconfig/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/swupdate-2020.04/scripts/kconfig/nconf.c:540: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(k_menu_items[items_num].str, data/swupdate-2020.04/scripts/kconfig/nconf.c:574: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(new_str, sizeof(new_str), fmt, ap); data/swupdate-2020.04/scripts/kconfig/nconf.c:1215: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(buf, sizeof(buf), fmt, ap); data/swupdate-2020.04/scripts/kconfig/qconf.cc:1030:24: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. head += QString().sprintf("<a href=\"s%p\">", sym); data/swupdate-2020.04/scripts/kconfig/qconf.cc:1039:23: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. head += QString().sprintf("<a href=\"s%p\">", sym); data/swupdate-2020.04/scripts/kconfig/qconf.cc:1067:22: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. debug += QString().sprintf("defined at %s:%d<br><br>", _menu->file->name, _menu->lineno); data/swupdate-2020.04/scripts/kconfig/qconf.cc:1090:23: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. debug += QString().sprintf("prompt: <a href=\"m%p\">", prop->menu); data/swupdate-2020.04/scripts/kconfig/qconf.cc:1163:22: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. *text += QString().sprintf("<a href=\"s%p\">", sym); data/swupdate-2020.04/scripts/kconfig/symbol.c:679: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/swupdate-2020.04/scripts/kconfig/symbol.c:907: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/swupdate-2020.04/scripts/kconfig/symbol.c:910: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/swupdate-2020.04/scripts/kconfig/util.c:110: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/swupdate-2020.04/scripts/kconfig/util.c:120: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/swupdate-2020.04/suricatta/server_hawkbit.c:1497: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(configData, keyvalue); data/swupdate-2020.04/test/test_crypt.c:43:40: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. static void do_crypt(struct cryptdata *crypt, unsigned char *CRYPTTEXT, unsigned char *PLAINTEXT) data/swupdate-2020.04/test/test_crypt.c:70:19: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. struct cryptdata crypt; data/swupdate-2020.04/test/test_crypt.c:71:11: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. hex2bin((crypt.key = calloc(1, strlen((const char *)KEY))), KEY); data/swupdate-2020.04/test/test_crypt.c:72:11: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. hex2bin((crypt.iv = calloc(1, strlen((const char *)IV))), IV); data/swupdate-2020.04/test/test_crypt.c:73:11: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. hex2bin((crypt.crypttext = calloc(1, strlen((const char *)CRYPTTEXT))), CRYPTTEXT); data/swupdate-2020.04/test/test_crypt.c:75:12: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. do_crypt(&crypt, &CRYPTTEXT[0], &PLAINTEXT[0]); data/swupdate-2020.04/test/test_crypt.c:77:7: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. free(crypt.key); data/swupdate-2020.04/test/test_crypt.c:78:7: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. free(crypt.iv); data/swupdate-2020.04/test/test_crypt.c:79:7: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. free(crypt.crypttext); data/swupdate-2020.04/test/test_crypt.c:91:19: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. struct cryptdata crypt; data/swupdate-2020.04/test/test_crypt.c:92:11: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. hex2bin((crypt.key = calloc(1, strlen((const char *)KEY))), KEY); data/swupdate-2020.04/test/test_crypt.c:93:11: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. hex2bin((crypt.iv = calloc(1, strlen((const char *)IV))), IV); data/swupdate-2020.04/test/test_crypt.c:94:11: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. hex2bin((crypt.crypttext = calloc(1, strlen((const char *)CRYPTTEXT))), CRYPTTEXT); data/swupdate-2020.04/test/test_crypt.c:96:12: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. do_crypt(&crypt, &CRYPTTEXT[0], &PLAINTEXT[0]); data/swupdate-2020.04/test/test_crypt.c:98:7: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. free(crypt.key); data/swupdate-2020.04/test/test_crypt.c:99:7: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. free(crypt.iv); data/swupdate-2020.04/test/test_crypt.c:100:7: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. free(crypt.crypttext); data/swupdate-2020.04/test/test_crypt.c:111:19: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. struct cryptdata crypt; data/swupdate-2020.04/test/test_crypt.c:112:11: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. hex2bin((crypt.key = calloc(1, strlen((const char *)KEY))), KEY); data/swupdate-2020.04/test/test_crypt.c:113:11: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. hex2bin((crypt.iv = calloc(1, strlen((const char *)IV))), IV); data/swupdate-2020.04/test/test_crypt.c:114:11: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. hex2bin((crypt.crypttext = calloc(1, strlen((const char *)CRYPTTEXT))), CRYPTTEXT); data/swupdate-2020.04/test/test_crypt.c:117:39: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. void *dcrypt = swupdate_DECRYPT_init(crypt.key, crypt.iv); data/swupdate-2020.04/test/test_crypt.c:117:50: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. void *dcrypt = swupdate_DECRYPT_init(crypt.key, crypt.iv); data/swupdate-2020.04/test/test_crypt.c:121:58: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. int ret = swupdate_DECRYPT_update(dcrypt, buffer, &len, crypt.crypttext, strlen((const char *)CRYPTTEXT) / 2); data/swupdate-2020.04/test/test_crypt.c:126:7: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. free(crypt.key); data/swupdate-2020.04/test/test_crypt.c:127:7: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. free(crypt.iv); data/swupdate-2020.04/test/test_crypt.c:128:7: [4] (crypto) crypt: The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment (CWE-327). Use a different algorithm, such as SHA-256, with a larger, non-repeating salt. free(crypt.crypttext); data/swupdate-2020.04/tools/swupdate-progress.c:98:4: [4] (shell) execl: 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. execl("/usr/bin/psplash", "psplash", (char *)0); data/swupdate-2020.04/tools/swupdate-progress.c:335:12: [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. ret = system(cmd); data/swupdate-2020.04/tools/swupdate-progress.c:348: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. if (system("reboot") < 0) { /* It should never happen */ data/swupdate-2020.04/tools/swupdate-sysrestart.c:252: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. if (system("reboot") < 0) { /* It should never happen */ data/swupdate-2020.04/core/notifier.c:348: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. if (sd_booted() && getenv("JOURNAL_STREAM") != NULL) { data/swupdate-2020.04/core/notifier.c:351:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (sscanf(getenv("JOURNAL_STREAM"), "%lu:%lu", &device, &inode) == 2) { data/swupdate-2020.04/core/swupdate.c:676:14: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, main_options, data/swupdate-2020.04/core/swupdate.c:738:14: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, main_options, data/swupdate-2020.04/core/util.c:105: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 *env_tmpdir = getenv("TMPDIR"); data/swupdate-2020.04/corelib/downloader.c:117:19: [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 ((choice = getopt_long(argc, argv, "t:u:r:a:", data/swupdate-2020.04/corelib/mtd-interface.c:162:11: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. real_s = realpath(s, NULL); data/swupdate-2020.04/corelib/mtd-interface.c:170:12: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. real_s = realpath(tmp_s, NULL); data/swupdate-2020.04/ipc/network_ipc.c:30:24: [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 *tmpdir = getenv("TMPDIR"); data/swupdate-2020.04/ipc/progress_ipc.c:28:24: [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 *tmpdir = getenv("TMPDIR"); data/swupdate-2020.04/mongoose/mongoose.c:9050:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((s = getenv(name)) != NULL) mg_addenv(blk, "%s=%s", name, s); data/swupdate-2020.04/mongoose/mongoose.c:9069:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if ((s = getenv("SERVER_NAME")) != NULL) { data/swupdate-2020.04/mongoose/mongoose_interface.c:526:19: [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 ((choice = getopt_long(argc, argv, "lp:sC:K:r:a:t:", data/swupdate-2020.04/scripts/kconfig/conf.c:504: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, "s", long_opts, NULL)) != -1) { data/swupdate-2020.04/scripts/kconfig/conf.c:531: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. seed_env = getenv("KCONFIG_SEED"); data/swupdate-2020.04/scripts/kconfig/conf.c:540: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/swupdate-2020.04/scripts/kconfig/conf.c:603: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/swupdate-2020.04/scripts/kconfig/conf.c:637: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. name = getenv("KCONFIG_NOSILENTUPDATE"); data/swupdate-2020.04/scripts/kconfig/confdata.c:72: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/swupdate-2020.04/scripts/kconfig/confdata.c:79: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/swupdate-2020.04/scripts/kconfig/confdata.c:117: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/swupdate-2020.04/scripts/kconfig/confdata.c:774: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/swupdate-2020.04/scripts/kconfig/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_AUTOHEADER"); data/swupdate-2020.04/scripts/kconfig/confdata.c:1011: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/swupdate-2020.04/scripts/kconfig/confdata.c:1135: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 *env = getenv("KCONFIG_PROBABILITY"); data/swupdate-2020.04/scripts/kconfig/gconf.c:1463: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/swupdate-2020.04/scripts/kconfig/lkc.h:42: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. return getenv( "CONFIG_" ) ?: CONFIG_; data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:331:14: [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. color_setup(getenv("MENUCONFIG_COLOR")); data/swupdate-2020.04/scripts/kconfig/mconf.c:1027: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. mode = getenv("MENUCONFIG_MODE"); data/swupdate-2020.04/scripts/kconfig/nconf.c:1493: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. mode = getenv("NCONFIG_MODE"); data/swupdate-2020.04/scripts/kconfig/symbol.c:1372: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/swupdate-2020.04/scripts/kconfig/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/swupdate-2020.04/suricatta/server_general.c:617:19: [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 ((choice = getopt_long(argc, argv, "u:l:r:w:p:", data/swupdate-2020.04/suricatta/server_hawkbit.c:1667:19: [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 ((choice = getopt_long(argc, argv, "t:i:c:u:p:xr:y::w:k:g:f:", data/swupdate-2020.04/suricatta/server_hawkbit.c:1727: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. if ((getenv("http_proxy") == NULL) && data/swupdate-2020.04/suricatta/server_hawkbit.c:1728: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. (getenv("all_proxy") == NULL)) { data/swupdate-2020.04/suricatta/suricatta.c:173:19: [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 ((choice = getopt_long(argc, argv, "de", data/swupdate-2020.04/tools/swupdate-client.c:165:14: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt(argc, argv, "dhqvp")) != EOF) { data/swupdate-2020.04/tools/swupdate-hawkbitcfg.c:90:14: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, "p:edh", data/swupdate-2020.04/tools/swupdate-progress.c:194:14: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, "cwprhs:e:", data/swupdate-2020.04/tools/swupdate-progress.c:226: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. tmpdir = getenv("TMPDIR"); data/swupdate-2020.04/tools/swupdate-sysrestart.c:146:14: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, "whs:", data/swupdate-2020.04/tools/swupdate-sysrestart.c:166: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. tmpdir = getenv("TMPDIR"); data/swupdate-2020.04/bindings/auxiliar.c:54:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[32]; data/swupdate-2020.04/bindings/auxiliar.c:62:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buf, "%p", lua_touserdata(L, 1)); data/swupdate-2020.04/bindings/auxiliar.c:98:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[45]; data/swupdate-2020.04/bindings/auxiliar.c:99:9: [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(msg, "%.35s expected", classname); data/swupdate-2020.04/bindings/auxiliar.c:112:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg[45]; data/swupdate-2020.04/bindings/auxiliar.c:113:9: [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(msg, "%.35s expected", groupname); data/swupdate-2020.04/bindings/lua_swupdate.c:93:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char addressBuffer[INET_ADDRSTRLEN]; data/swupdate-2020.04/bindings/lua_swupdate.c:94:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char netmaskBuffer[INET_ADDRSTRLEN]; data/swupdate-2020.04/bindings/lua_swupdate.c:95:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2 * INET_ADDRSTRLEN]; data/swupdate-2020.04/bootloader/ebg.c:158: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). if (!(fp = fopen(filename, "rb"))) { data/swupdate-2020.04/bootloader/grub.c:20: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(GRUBENV_PATH, "rb"); data/swupdate-2020.04/bootloader/grub.c:109: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(script, "rb"); data/swupdate-2020.04/bootloader/grub.c:180: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(GRUBENV_PATH_NEW, "wb"); data/swupdate-2020.04/core/artifacts_versions.c:51: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(SW_VERSIONS_FILE, "r"); data/swupdate-2020.04/core/cpio_utils.c:93: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 buf[512]; data/swupdate-2020.04/core/cpio_utils.c:167:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&buffer, buf+chunklen, len-chunklen); data/swupdate-2020.04/core/cpio_utils.c:229: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(buffer, s->output, size); data/swupdate-2020.04/core/cpio_utils.c:264: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(buffer, s->output, size); data/swupdate-2020.04/core/cpio_utils.c:385: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 md_value[64]; /* data/swupdate-2020.04/core/cpio_utils.c:392: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 ivtbuf[32]; data/swupdate-2020.04/core/cpio_utils.c:589:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hashstring[2 * SHA256_HASH_LENGTH + 1]; data/swupdate-2020.04/core/cpio_utils.c:590:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char newhashstring[2 * SHA256_HASH_LENGTH + 1]; data/swupdate-2020.04/core/cpio_utils.c:649: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 buf[sizeof(fhdr->filename)]; data/swupdate-2020.04/core/cpio_utils.c:680: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 output_file[MAX_IMAGE_FNAME]; data/swupdate-2020.04/core/installer.c:126:10: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). char *tmpfile; data/swupdate-2020.04/core/installer.c:130:18: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). if (asprintf(&tmpfile, "%s%s", get_tmpdir(), script->fname) == data/swupdate-2020.04/core/installer.c:137:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fdin = open(tmpfile, O_RDONLY); data/swupdate-2020.04/core/installer.c:137:16: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). fdin = open(tmpfile, O_RDONLY); data/swupdate-2020.04/core/installer.c:138:9: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). free(tmpfile); data/swupdate-2020.04/core/installer.c:168: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[MAX_BOOT_SCRIPT_LINE_LENGTH]; data/swupdate-2020.04/core/installer.c:226: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(img->type, "dummy"); data/swupdate-2020.04/core/installer.c:313:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). img->fdin = open(filename, O_RDONLY); data/swupdate-2020.04/core/network_thread.c:265:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(msg.data.msg, "Post-update actions successfully executed."); data/swupdate-2020.04/core/network_thread.c:268:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(msg.data.msg, "Post-update actions failed."); data/swupdate-2020.04/core/network_thread.c:360:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(instp->info, msg.data.instmsg.buf, data/swupdate-2020.04/core/network_thread.c:375:6: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(msg.data.msg, "Installation in progress"); data/swupdate-2020.04/core/network_thread.c:413:4: [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(msg.data.msg, "Wrong request: aborting"); data/swupdate-2020.04/core/notifier.c:56: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[NOTIFY_BUF_SIZE]; data/swupdate-2020.04/core/notifier.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 current[80]; data/swupdate-2020.04/core/notifier.c:366: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[60]; data/swupdate-2020.04/core/parser.c:238:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(sigfile, ".sig"); data/swupdate-2020.04/core/parsing_library.c:191: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 hash_ascii[80]; data/swupdate-2020.04/core/pctl.c:284:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[2][SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/core/pctl.c:350:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(pbuf, &pbuf[last], left); data/swupdate-2020.04/core/state.c:37: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 value_str[2] = {value, '\0'}; data/swupdate-2020.04/core/stream_interface.c:76: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 output_file[MAX_IMAGE_FNAME]; data/swupdate-2020.04/core/stream_interface.c:126: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 output_file[MAX_IMAGE_FNAME]; data/swupdate-2020.04/core/stream_interface.c: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 tmpfilename[MAX_IMAGE_FNAME]; data/swupdate-2020.04/core/stream_interface.c:360: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 output_file[MAX_IMAGE_FNAME]; data/swupdate-2020.04/core/stream_interface.c:380:10: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). tmpfd = mkstemp(tmpfilename); data/swupdate-2020.04/core/stream_interface.c:527:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). inst.fd = open(software->output, O_RDONLY, S_IRUSR); data/swupdate-2020.04/core/stream_interface.c:606: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, inst.info, len); data/swupdate-2020.04/core/swupdate.c:234:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[MAX_IMAGE_FNAME]; data/swupdate-2020.04/core/swupdate.c:236: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 hex[4]; data/swupdate-2020.04/core/swupdate.c:269:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&buf[3 * i], hex, 3); data/swupdate-2020.04/core/swupdate.c:280:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(fname, O_RDONLY); data/swupdate-2020.04/core/swupdate.c:308: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). fdsw = open(fname, O_RDONLY); data/swupdate-2020.04/core/swupdate.c:518: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 tmp[SWUPDATE_GENERAL_STRING_SIZE] = ""; data/swupdate-2020.04/core/swupdate.c:601:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[MAX_IMAGE_FNAME]; data/swupdate-2020.04/core/swupdate.c:607: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 image_url[MAX_URL]; data/swupdate-2020.04/core/swupdate.c:608: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 main_options[256]; data/swupdate-2020.04/core/swupdate.c:636:2: [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(main_options, "vhni:e:l:Lcf:p:P:o:N:R:M"); data/swupdate-2020.04/core/swupdate.c:638:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(main_options, "b:"); data/swupdate-2020.04/core/swupdate.c:641:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(main_options, "d:"); data/swupdate-2020.04/core/swupdate.c:644:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(main_options, "u:"); data/swupdate-2020.04/core/swupdate.c:647:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(main_options, "w:"); data/swupdate-2020.04/core/swupdate.c:650:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(main_options, "H:"); data/swupdate-2020.04/core/swupdate.c:653:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(main_options, "k:"); data/swupdate-2020.04/core/swupdate.c:657:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(main_options, "K:"); data/swupdate-2020.04/core/swupdate_dict.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(script, "rb"); data/swupdate-2020.04/core/util.c:36: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 key[32]; data/swupdate-2020.04/core/util.c:37: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 ivt[16]; data/swupdate-2020.04/core/util.c:212: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, &src[first], len); data/swupdate-2020.04/core/util.c:254:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fdout = open(filename, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR ); data/swupdate-2020.04/core/util.c:311: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(HW_FILE, "r"); data/swupdate-2020.04/core/util.c:354: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 errbuf[256]; data/swupdate-2020.04/core/util.c:475: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(s, "%02x", hash[i]); data/swupdate-2020.04/core/util.c:517: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/swupdate-2020.04/core/util.c:606: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 delim[2]; data/swupdate-2020.04/core/util.c:722: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 errmsg[255]; data/swupdate-2020.04/core/util.c:774: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 msbuf[4]; data/swupdate-2020.04/core/util.c:793: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(tmp, msbuf, 3); data/swupdate-2020.04/corelib/channel_curl.c:213: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(&(mem->memory[mem->size]), streamdata, realsize); data/swupdate-2020.04/corelib/channel_curl.c:414: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(info, buffer, size * nitems); data/swupdate-2020.04/corelib/channel_curl.c:714: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(ptr, &channel_data->request_body[channel_data->offs], n); data/swupdate-2020.04/corelib/channel_curl.c:1019: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 sha1hash[SWUPDATE_SHA_DIGEST_LENGTH]; data/swupdate-2020.04/corelib/channel_curl.c:1027: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 sha1hexchar[3]; data/swupdate-2020.04/corelib/channel_curl.c:1029:4: [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(sha1hexchar, "%02x", sha1hash[i]); data/swupdate-2020.04/corelib/downloader.c:44:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (channel->open(channel, channel_data) != CHANNEL_OK) { data/swupdate-2020.04/corelib/downloader.c:66: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 tmp[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/corelib/lua_compat.c:26: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(newptr, B->ptr, B->nelems); data/swupdate-2020.04/corelib/lua_interface.c:248: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 seek_str[MAX_SEEK_STRING_SIZE]; data/swupdate-2020.04/corelib/lua_interface.c:409:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer, buf, len); data/swupdate-2020.04/corelib/mtd-interface.c:23: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 mtd_ubi_blacklist[100] = { 0 }; data/swupdate-2020.04/corelib/mtd-interface.c:34: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 mtd_device[80]; data/swupdate-2020.04/corelib/mtd-interface.c:49:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(mtd_device, O_RDWR)) < 0) { data/swupdate-2020.04/corelib/mtd-interface.c:164: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 tmp_s[PATH_MAX] = {0}; data/swupdate-2020.04/corelib/mtd-interface.c:308: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(&mtd_info->dev_info, &dev_info, sizeof(struct ubi_dev_info)); data/swupdate-2020.04/corelib/mtd-interface.c:384: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 list[100]; data/swupdate-2020.04/corelib/mtd-interface.c:491: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 node[64]; data/swupdate-2020.04/corelib/swupdate_rsa_verify.c:150: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(file, "r"); data/swupdate-2020.04/corelib/swupdate_rsa_verify_mbedtls.c:51: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(filename, O_RDONLY); data/swupdate-2020.04/corelib/swupdate_settings.c:39: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 node[1024]; data/swupdate-2020.04/corelib/swupdate_settings.c:139: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[80], value[80]; data/swupdate-2020.04/corelib/verify_signature_mbedtls.c:10: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 result[16]; data/swupdate-2020.04/handlers/archive_handler.c:197: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[255]; data/swupdate-2020.04/handlers/archive_handler.c:201: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 pwd[256] = "\0"; data/swupdate-2020.04/handlers/archive_handler.c:306:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fdout = open(FIFO, O_WRONLY); data/swupdate-2020.04/handlers/boot_handler.c:34: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[MAX_IMAGE_FNAME]; data/swupdate-2020.04/handlers/boot_handler.c:63: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(filename, "r"); data/swupdate-2020.04/handlers/diskpart_handler.c:45: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 type[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/handlers/diskpart_handler.c:46: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[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/handlers/dummy_handler.c:30:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fdout = open("/dev/null", O_WRONLY); data/swupdate-2020.04/handlers/flash_hamming1_handler.c:136: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 oobbuf[64]; data/swupdate-2020.04/handlers/flash_hamming1_handler.c:173: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 code[3]; data/swupdate-2020.04/handlers/flash_hamming1_handler.c:174: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 ecc[12]; data/swupdate-2020.04/handlers/flash_hamming1_handler.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 mtd_device[LINESIZE]; data/swupdate-2020.04/handlers/flash_hamming1_handler.c:207: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). ofd = open(mtd_device, O_CREAT | O_RDWR, S_IRWXU | S_IRWXG); data/swupdate-2020.04/handlers/flash_hamming1_handler.c:240: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(page + mtd->min_io_size, page, mtd->min_io_size); data/swupdate-2020.04/handlers/flash_handler.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 mtd_device[LINESIZE]; data/swupdate-2020.04/handlers/flash_handler.c:122:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(mtd_device, O_RDWR)) < 0) { data/swupdate-2020.04/handlers/flash_handler.c:289: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 mtd_device[LINESIZE]; data/swupdate-2020.04/handlers/flash_handler.c:299:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fdout = open(mtd_device, O_RDWR)) < 0) { data/swupdate-2020.04/handlers/lua_scripthandler.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 filename[MAX_IMAGE_FNAME + strlen(tmp) + 2 + strlen(img->type_data)]; data/swupdate-2020.04/handlers/raw_handler.c:75:16: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd_force_ro = open(sysfs_path, O_RDWR); data/swupdate-2020.04/handlers/raw_handler.c:118:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fdout = open(img->device, O_RDWR); data/swupdate-2020.04/handlers/raw_handler.c:156: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). fdin = open(entry->value, O_RDONLY); data/swupdate-2020.04/handlers/raw_handler.c:167:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fdout = open(img->device, O_RDWR); data/swupdate-2020.04/handlers/raw_handler.c:195: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[255]; data/swupdate-2020.04/handlers/rdiff_handler.c:113: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. (void)memcpy(rdiff_state->inbuf, buf, *len); data/swupdate-2020.04/handlers/rdiff_handler.c:128: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. (void)memcpy(target, buf, buflen); data/swupdate-2020.04/handlers/rdiff_handler.c:252:32: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((rdiff_state.dest_file = fopen(img->device, "wb+")) == NULL) { data/swupdate-2020.04/handlers/rdiff_handler.c:269:13: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). if ((fd = mkstemp(dest_file_filename)) == -1) { data/swupdate-2020.04/handlers/rdiff_handler.c:310:31: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((rdiff_state.base_file = fopen(base_file_filename, "rb+")) == NULL) { data/swupdate-2020.04/handlers/rdiff_handler.c:386: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[DFLTPHYS]; data/swupdate-2020.04/handlers/readback_handler.c:41: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 hash[SHA256_HASH_LENGTH]; data/swupdate-2020.04/handlers/readback_handler.c:67:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fdin = open(img->device, O_RDONLY); data/swupdate-2020.04/handlers/remote_handler.c:44: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 (zmq_msg_data (msg), key, strlen(key)); data/swupdate-2020.04/handlers/remote_handler.c:51: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 (zmq_msg_data(msg), body, size); data/swupdate-2020.04/handlers/remote_handler.c:99: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 (string, zmq_msg_data (&self->frame[0]), size); data/swupdate-2020.04/handlers/remote_handler.c:160: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 bufcmd[80]; data/swupdate-2020.04/handlers/shell_scripthandler.c:33: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 shellscript[MAX_IMAGE_FNAME + strlen(tmp) + data/swupdate-2020.04/handlers/ssbl_handler.c:47: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[MAX_VOLNAME]; data/swupdate-2020.04/handlers/ssbl_handler.c:176: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 mtd_device[80]; data/swupdate-2020.04/handlers/ssbl_handler.c:219:13: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(mtd_device, O_RDWR)) < 0) { data/swupdate-2020.04/handlers/ssbl_handler.c:255:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(mtd_device, O_RDWR)) < 0) { data/swupdate-2020.04/handlers/ubivol_handler.c:110: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 masternode[64]; data/swupdate-2020.04/handlers/ubivol_handler.c:136: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 node[64]; data/swupdate-2020.04/handlers/ubivol_handler.c:138: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 sbuf[128]; data/swupdate-2020.04/handlers/ubivol_handler.c:198:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fdout = open(node, O_RDWR); data/swupdate-2020.04/handlers/ubivol_handler.c:239: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 node[64]; data/swupdate-2020.04/handlers/ubivol_handler.c:378: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 node[64]; data/swupdate-2020.04/handlers/ubivol_handler.c:496: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[2]; data/swupdate-2020.04/handlers/ubivol_handler.c:498: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 prop[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/handlers/ubivol_handler.c:499: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 masternode[UBI_MAX_VOLUME_NAME+1]; data/swupdate-2020.04/handlers/ucfw_handler.c:91: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 gpiodev[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/handlers/ucfw_handler.c:108: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[1024]; /* enough for 3 records */ data/swupdate-2020.04/handlers/ucfw_handler.c:229: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(&buf[len], "%02X", chksum & 0xFF); data/swupdate-2020.04/handlers/ucfw_handler.c:292:8: [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. len = sprintf(tmp, "%cX: %d bytes:", data/swupdate-2020.04/handlers/ucfw_handler.c:297: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(tmp, "%c", buf[i]); data/swupdate-2020.04/handlers/ucfw_handler.c:386: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 msg[128]; data/swupdate-2020.04/handlers/ucfw_handler.c:397:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). priv->fduart = open(img->device, O_RDWR); data/swupdate-2020.04/handlers/ucfw_handler.c:423: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 msg[80]; data/swupdate-2020.04/include/channel.h:23:21: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). channel_op_res_t (*open)(channel_t *this, void *cfg); data/swupdate-2020.04/include/channel_curl.h:67: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 sha1hash[SWUPDATE_SHA_DIGEST_LENGTH * 2 + 1]; data/swupdate-2020.04/include/compat.h:22:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (char *)memcpy(__out, __in, __len - 1); \ data/swupdate-2020.04/include/cpiohdr.h:29: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 c_magic[6]; data/swupdate-2020.04/include/cpiohdr.h:30: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 c_ino[8]; data/swupdate-2020.04/include/cpiohdr.h:31: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 c_mode[8]; data/swupdate-2020.04/include/cpiohdr.h:32: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 c_uid[8]; data/swupdate-2020.04/include/cpiohdr.h:33: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 c_gid[8]; data/swupdate-2020.04/include/cpiohdr.h:34: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 c_nlink[8]; data/swupdate-2020.04/include/cpiohdr.h:35: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 c_mtime[8]; data/swupdate-2020.04/include/cpiohdr.h:36: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 c_filesize[8]; data/swupdate-2020.04/include/cpiohdr.h:37: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 c_dev_maj[8]; data/swupdate-2020.04/include/cpiohdr.h:38: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 c_dev_min[8]; data/swupdate-2020.04/include/cpiohdr.h:39: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 c_rdev_maj[8]; data/swupdate-2020.04/include/cpiohdr.h:40: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 c_rdev_min[8]; data/swupdate-2020.04/include/cpiohdr.h:41: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 c_namesize[8]; data/swupdate-2020.04/include/cpiohdr.h:42: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 c_chksum[8]; data/swupdate-2020.04/include/cpiohdr.h:49: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[MAX_IMAGE_FNAME]; data/swupdate-2020.04/include/handler.h:38: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[64]; data/swupdate-2020.04/include/network_ipc.h:50: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 msg[128]; data/swupdate-2020.04/include/network_ipc.h:55: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 desc[2048]; data/swupdate-2020.04/include/network_ipc.h:62: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[2048]; /* data/swupdate-2020.04/include/network_ipc.h:68: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 key_ascii[65]; /* Key size in ASCII (256 bit, 32 bytes bin) + termination */ data/swupdate-2020.04/include/network_ipc.h:69: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 ivt_ascii[33]; /* Key size in ASCII (16 bytes bin) + termination */ data/swupdate-2020.04/include/progress_ipc.h:32: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 cur_image[256]; /* Name of image to be installed */ data/swupdate-2020.04/include/progress_ipc.h:33: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 hnd_name[64]; /* Name of running hanler */ data/swupdate-2020.04/include/progress_ipc.h:36: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 info[2048]; /* additional information about install */ data/swupdate-2020.04/include/swupdate.h:52: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[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:53:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char version[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:63: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 type[SWUPDATE_GENERAL_STRING_SIZE]; /* Handler name */ data/swupdate-2020.04/include/swupdate.h:64:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fname[MAX_IMAGE_FNAME]; /* Filename in CPIO archive */ data/swupdate-2020.04/include/swupdate.h:65: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 volname[MAX_VOLNAME]; /* Useful for UBI */ data/swupdate-2020.04/include/swupdate.h:66: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[MAX_VOLNAME]; /* device associated with image if any */ data/swupdate-2020.04/include/swupdate.h:67: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[MAX_IMAGE_FNAME]; /* Path where image must be installed */ data/swupdate-2020.04/include/swupdate.h:68: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 type_data[SWUPDATE_GENERAL_STRING_SIZE]; /* Data for handler */ data/swupdate-2020.04/include/swupdate.h:69: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 extract_file[MAX_IMAGE_FNAME]; data/swupdate-2020.04/include/swupdate.h:70: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 filesystem[MAX_IMAGE_FNAME]; data/swupdate-2020.04/include/swupdate.h:77: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 ivt_ascii[32]; data/swupdate-2020.04/include/swupdate.h:88: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 sha256[SHA256_HASH_LENGTH]; /* SHA-256 is 32 byte */ data/swupdate-2020.04/include/swupdate.h:95: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 boardname[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:96: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 revision[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h: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 name[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:104: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 exec[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:105: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 options[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:119: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 mtdblacklist[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:126: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 publickeyfname[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:127: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 aeskeyfname[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h: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 postupdatecmd[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:129:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char preupdatecmd[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:130: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 minimum_version[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:131: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 current_version[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h: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 forced_signer_name[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:137: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[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:138: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 description[SWUPDATE_UPDATE_DESCRIPTION_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:139: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 version[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.h:141: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 software_set[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.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 running_mode[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/swupdate.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 output[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/include/util.h:79: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 errormsg[64]; /* error message if installation failed */ data/swupdate-2020.04/include/util.h: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 info[2048]; /* info */ data/swupdate-2020.04/include/util.h:90: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 tmpbuf[NOTIFY_BUF_SIZE]; \ data/swupdate-2020.04/ipc/network_ipc.c:207:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(msg.data.instmsg.buf, buf, len); data/swupdate-2020.04/mongoose/mongoose.c:70: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 message[MG_CTL_MSG_MESSAGE_SIZE]; data/swupdate-2020.04/mongoose/mongoose.c:346:25: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static const unsigned char tab[128] = { data/swupdate-2020.04/mongoose/mongoose.c:585: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 prefix[CS_LOG_PREFIX_LEN], *q; data/swupdate-2020.04/mongoose/mongoose.c:604: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(prefix, p, fl); data/swupdate-2020.04/mongoose/mongoose.c:691: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 d_name[MAX_PATH]; data/swupdate-2020.04/mongoose/mongoose.c:694: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 d_name[256]; data/swupdate-2020.04/mongoose/mongoose.c:732:3: [2] (buffer) wchar_t: 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. wchar_t wpath[MAX_PATH]; data/swupdate-2020.04/mongoose/mongoose.c:743:14: [2] (buffer) wcscat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) wcscat(wpath, L"\\*"); data/swupdate-2020.04/mongoose/mongoose.c:1077:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, buf, len); data/swupdate-2020.04/mongoose/mongoose.c:1080: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(p, buf, t); data/swupdate-2020.04/mongoose/mongoose.c:1088: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(ctx->in, buf, 64); data/swupdate-2020.04/mongoose/mongoose.c:1095: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(ctx->in, buf, len); data/swupdate-2020.04/mongoose/mongoose.c:1098:28: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void cs_md5_final(unsigned char digest[16], cs_md5_ctx *ctx) { data/swupdate-2020.04/mongoose/mongoose.c:1124: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(digest, ctx->buf, 16); data/swupdate-2020.04/mongoose/mongoose.c:1148: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 c[64]; data/swupdate-2020.04/mongoose/mongoose.c:1191:65: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static void cs_sha1_transform(uint32_t state[5], const unsigned char buffer[64]) { data/swupdate-2020.04/mongoose/mongoose.c:1195: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(block, buffer, 64); data/swupdate-2020.04/mongoose/mongoose.c:1315: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(&context->buffer[j], data, (i = 64 - j)); data/swupdate-2020.04/mongoose/mongoose.c:1323: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(&context->buffer[j], &data[i], len - i); data/swupdate-2020.04/mongoose/mongoose.c:1326:29: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void cs_sha1_final(unsigned char digest[20], cs_sha1_ctx *context) { data/swupdate-2020.04/mongoose/mongoose.c:1328: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 finalcount[8], c; data/swupdate-2020.04/mongoose/mongoose.c:1350:34: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void cs_hmac_sha1(const unsigned char *key, size_t keylen, data/swupdate-2020.04/mongoose/mongoose.c:1351:34: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const unsigned char *data, size_t datalen, data/swupdate-2020.04/mongoose/mongoose.c:1352:28: [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[20]) { data/swupdate-2020.04/mongoose/mongoose.c:1354: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 buf1[64], buf2[64], tmp_key[20], i; data/swupdate-2020.04/mongoose/mongoose.c:1366: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(buf1, key, keylen); data/swupdate-2020.04/mongoose/mongoose.c:1367: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(buf2, key, keylen); data/swupdate-2020.04/mongoose/mongoose.c:1453:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(a->buf + off, buf, len); data/swupdate-2020.04/mongoose/mongoose.c:1472:24: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (buf != NULL) memcpy(a->buf + off, buf, len); data/swupdate-2020.04/mongoose/mongoose.c:1519: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(to, from, sizeof(*to)); data/swupdate-2020.04/mongoose/mongoose.c:1577:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sc, s.p, s.len); data/swupdate-2020.04/mongoose/mongoose.c:1712: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 tmp[40]; data/swupdate-2020.04/mongoose/mongoose.c:1902: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[MAX_PATH * 2], buf2[MAX_PATH * 2], *p; data/swupdate-2020.04/mongoose/mongoose.c:1912:9: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). ret = MultiByteToWideChar(CP_UTF8, 0, buf, -1, wbuf, (int) wbuf_len); data/swupdate-2020.04/mongoose/mongoose.c:2228: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(dst, src, sizeof(*dst)); data/swupdate-2020.04/mongoose/mongoose.c:2500: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 mem[MG_VPRINTF_BUFFER_SIZE], *buf = mem; data/swupdate-2020.04/mongoose/mongoose.c:2538: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(ina, &h->sin_addr, sizeof(*ina)); data/swupdate-2020.04/mongoose/mongoose.c:2547: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(ina, he->h_addr_list[0], sizeof(*ina)); data/swupdate-2020.04/mongoose/mongoose.c:2621: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[100]; data/swupdate-2020.04/mongoose/mongoose.c:3090: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 host[MG_MAX_HOST_LEN]; data/swupdate-2020.04/mongoose/mongoose.c:3203: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 host[MG_MAX_HOST_LEN]; data/swupdate-2020.04/mongoose/mongoose.c:3291: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(ctl_msg.message, data, len); data/swupdate-2020.04/mongoose/mongoose.c:4207: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(sa, &nc->sa, sizeof(*sa)); data/swupdate-2020.04/mongoose/mongoose.c:4302:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[10] = {MG_SOCKS_VERSION, MG_SOCKS_CMD_CONNECT, 0, data/swupdate-2020.04/mongoose/mongoose.c:4314:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf + 4, &d->c->sa.sin.sin_addr, 4); data/swupdate-2020.04/mongoose/mongoose.c:4315:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf + 8, &d->c->sa.sin.sin_port, 2); data/swupdate-2020.04/mongoose/mongoose.c:4390:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, d->s->recv_mbuf.buf, len); data/swupdate-2020.04/mongoose/mongoose.c:4815: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(identity, ctx->psk.buf, ctx->identity_len + 1); data/swupdate-2020.04/mongoose/mongoose.c:4816: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(psk, ctx->psk.buf + ctx->identity_len + 1, key_len); data/swupdate-2020.04/mongoose/mongoose.c:4824: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 key[32]; data/swupdate-2020.04/mongoose/mongoose.c:5307:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[50]; data/swupdate-2020.04/mongoose/mongoose.c:5336: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 key[32]; data/swupdate-2020.04/mongoose/mongoose.c:5613:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char port_str[20]; data/swupdate-2020.04/mongoose/mongoose.c:5614:24: [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. int port_str_len = sprintf(port_str, ":%u", port); data/swupdate-2020.04/mongoose/mongoose.c:6119:21: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). hm->resp_code = atoi(s); data/swupdate-2020.04/mongoose/mongoose.c:6167: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[MG_MAX_HTTP_SEND_MBUF]; data/swupdate-2020.04/mongoose/mongoose.c:6572:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char addr[32]; data/swupdate-2020.04/mongoose/mongoose.c:6611: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 boundary_buf[100]; data/swupdate-2020.04/mongoose/mongoose.c:7047: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 bbody[100], *pbody = bbody; data/swupdate-2020.04/mongoose/mongoose.c:7051: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 bhead[150], *phead = bhead; data/swupdate-2020.04/mongoose/mongoose.c:7112:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, header->p, header->len); data/swupdate-2020.04/mongoose/mongoose.c:7139:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char etag[50], current_time[50], last_modified[50], range[70]; data/swupdate-2020.04/mongoose/mongoose.c:7306: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 chunk_size[50]; data/swupdate-2020.04/mongoose/mongoose.c:7316: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 mem[MG_VPRINTF_BUFFER_SIZE], *buf = mem; data/swupdate-2020.04/mongoose/mongoose.c:7336: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 mem[MG_VPRINTF_BUFFER_SIZE], *buf = mem; data/swupdate-2020.04/mongoose/mongoose.c:7439: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 fmt[64]; data/swupdate-2020.04/mongoose/mongoose.c:7494:20: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static void cs_md5(char buf[33], ...) { data/swupdate-2020.04/mongoose/mongoose.c:7495: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 hash[16]; data/swupdate-2020.04/mongoose/mongoose.c:7520: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 ha2[33]; data/swupdate-2020.04/mongoose/mongoose.c:7533: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 ha1[33], resp[33], cnonce[40]; data/swupdate-2020.04/mongoose/mongoose.c:7565: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 username_buf[50], cnonce_buf[64], response_buf[40], uri_buf[200], data/swupdate-2020.04/mongoose/mongoose.c:7616: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[128], f_user[sizeof(buf)], f_ha1[sizeof(buf)], f_domain[sizeof(buf)]; data/swupdate-2020.04/mongoose/mongoose.c:7617: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 exp_resp[33]; data/swupdate-2020.04/mongoose/mongoose.c:7645: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[MG_MAX_PATH]; data/swupdate-2020.04/mongoose/mongoose.c:7706: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 size[64], mod[64], path[MG_MAX_PATH]; data/swupdate-2020.04/mongoose/mongoose.c:7744:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MG_MAX_PATH + 1]; data/swupdate-2020.04/mongoose/mongoose.c:7869: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 local_port[20] = {'%'}; data/swupdate-2020.04/mongoose/mongoose.c:7924: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 burl[256], *purl = burl; data/swupdate-2020.04/mongoose/mongoose.c:8082: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(p, root.p, root.len); data/swupdate-2020.04/mongoose/mongoose.c:8123:11: [2] (buffer) wchar_t: 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. wchar_t buf[MG_MAX_PATH * 2]; data/swupdate-2020.04/mongoose/mongoose.c:8184: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 month_str[32]; data/swupdate-2020.04/mongoose/mongoose.c:8209:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char etag[64]; data/swupdate-2020.04/mongoose/mongoose.c:8452:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(fus->lfn, lfn.p, lfn.len); data/swupdate-2020.04/mongoose/mongoose.c:8564: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 conn_addr_buf[2]; data/swupdate-2020.04/mongoose/mongoose.c:8823: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[MG_CGI_ENVIRONMENT_SIZE]; /* Environment buffer */ data/swupdate-2020.04/mongoose/mongoose.c:8824: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. const char *vars[MG_MAX_CGI_ENVIR_VARS]; /* char *envp[] */ data/swupdate-2020.04/mongoose/mongoose.c:8846: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[BUFSIZ]; data/swupdate-2020.04/mongoose/mongoose.c:8865: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[BUFSIZ]; data/swupdate-2020.04/mongoose/mongoose.c:8893:3: [2] (buffer) wchar_t: 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. wchar_t buf[MG_MAX_PATH], buf2[MG_MAX_PATH]; data/swupdate-2020.04/mongoose/mongoose.c:8905:3: [2] (buffer) wchar_t: 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. wchar_t wcmd[MG_MAX_PATH], full_dir[MG_MAX_PATH]; data/swupdate-2020.04/mongoose/mongoose.c:8906: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[MG_MAX_PATH], buf2[MG_MAX_PATH], buf5[MG_MAX_PATH], data/swupdate-2020.04/mongoose/mongoose.c:8977: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[500]; data/swupdate-2020.04/mongoose/mongoose.c:9063: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[100]; data/swupdate-2020.04/mongoose/mongoose.c:9236: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 dir[MG_MAX_PATH]; data/swupdate-2020.04/mongoose/mongoose.c:9318: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[BUFSIZ]; data/swupdate-2020.04/mongoose/mongoose.c:9328: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 file_name[MG_MAX_PATH], path[MG_MAX_PATH], *p; data/swupdate-2020.04/mongoose/mongoose.c:9374: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 cmd[BUFSIZ]; data/swupdate-2020.04/mongoose/mongoose.c:9401: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[BUFSIZ], *p = buf + btag.len; /* p points to SSI directive */ data/swupdate-2020.04/mongoose/mongoose.c:9544: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 mtime[64]; data/swupdate-2020.04/mongoose/mongoose.c:9583:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char uri[MG_MAX_PATH]; data/swupdate-2020.04/mongoose/mongoose.c:9650:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[MG_MAX_PATH]; data/swupdate-2020.04/mongoose/mongoose.c:9685:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MG_MAX_PATH]; data/swupdate-2020.04/mongoose/mongoose.c:9722:7: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[MG_MAX_PATH]; data/swupdate-2020.04/mongoose/mongoose.c:10022: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 header[10]; data/swupdate-2020.04/mongoose/mongoose.c:10032: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(&header[2], &tmp, sizeof(tmp)); data/swupdate-2020.04/mongoose/mongoose.c:10038: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(&header[2], &tmp, sizeof(tmp)); data/swupdate-2020.04/mongoose/mongoose.c:10040: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(&header[6], &tmp, sizeof(tmp)); data/swupdate-2020.04/mongoose/mongoose.c:10103: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 mem[MG_VPRINTF_BUFFER_SIZE], *buf = mem; data/swupdate-2020.04/mongoose/mongoose.c:10167: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 sha[20]; data/swupdate-2020.04/mongoose/mongoose.c:10168: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 b64_sha[30]; data/swupdate-2020.04/mongoose/mongoose.c:10211: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 key[25]; data/swupdate-2020.04/mongoose/mongoose.c:10322:3: [2] (buffer) wchar_t: 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. wchar_t wpath[MG_MAX_PATH]; data/swupdate-2020.04/mongoose/mongoose.c:10333:3: [2] (buffer) wchar_t: 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. wchar_t wpath[MG_MAX_PATH], wmode[10]; data/swupdate-2020.04/mongoose/mongoose.c:10338: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). return fopen(path, mode); data/swupdate-2020.04/mongoose/mongoose.c:10344:3: [2] (buffer) wchar_t: 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. wchar_t wpath[MG_MAX_PATH]; data/swupdate-2020.04/mongoose/mongoose.c:10348:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). return open(path, flag, mode); /* LCOV_EXCL_LINE */ data/swupdate-2020.04/mongoose/mongoose.c:10477: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 ascii[17] = ""; data/swupdate-2020.04/mongoose/mongoose.c:10505: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 tmp[80]; data/swupdate-2020.04/mongoose/mongoose.c:10519: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 src[60], dst[60]; data/swupdate-2020.04/mongoose/mongoose.c:11260:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char *) te->topic, topic.p, topic.len); data/swupdate-2020.04/mongoose/mongoose.c:11282:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[100], *p = buf; data/swupdate-2020.04/mongoose/mongoose.c:11400:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, rr->rdata.p, data_len); data/swupdate-2020.04/mongoose/mongoose.c:11407:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, rr->rdata.p, data_len); data/swupdate-2020.04/mongoose/mongoose.c:11561:20: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. if (((unsigned char *) data)[0] & 0xc0) { data/swupdate-2020.04/mongoose/mongoose.c:11678: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(dst, data, chunk_len); data/swupdate-2020.04/mongoose/mongoose.c:11778: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 rname[512]; data/swupdate-2020.04/mongoose/mongoose.c:11823: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 name[1024]; data/swupdate-2020.04/mongoose/mongoose.c:11848:3: [2] (buffer) wchar_t: 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. wchar_t subkey[512], value[128], data/swupdate-2020.04/mongoose/mongoose.c:11891: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 line[512]; data/swupdate-2020.04/mongoose/mongoose.c:11918: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 line[1024]; data/swupdate-2020.04/mongoose/mongoose.c:11920: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 alias[256]; data/swupdate-2020.04/mongoose/mongoose.c:12016:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char addr[32]; data/swupdate-2020.04/mongoose/mongoose.c:12042: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 dns_server_buff[17], nameserver_url[26]; data/swupdate-2020.04/mongoose/mongoose.c:12583: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(ptr, cm->token.p, cm->token.len); data/swupdate-2020.04/mongoose/mongoose.c:12605:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr, opt->value.p, opt->value.len); data/swupdate-2020.04/mongoose/mongoose.c:12616: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(ptr, cm->payload.p, cm->payload.len); data/swupdate-2020.04/mongoose/mongoose.c:12785:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&buf[40], &sec, sizeof(sec)); data/swupdate-2020.04/mongoose/mongoose.c:12886: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 url[100], *p_url = url; data/swupdate-2020.04/mongoose/mongoose.c:13019: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 reply[2] = {MG_SOCKS_VERSION, MG_SOCKS_HANDSHAKE_FAILURE}; data/swupdate-2020.04/mongoose/mongoose.c:13082: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 addr[300]; data/swupdate-2020.04/mongoose/mongoose.c:13705:5: [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). int open(const char *pathname, unsigned flags, int mode) { data/swupdate-2020.04/mongoose/mongoose.c:13895:34: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char c = ((const char *) buf)[i]; data/swupdate-2020.04/mongoose/mongoose.c:14044:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char a[16]; data/swupdate-2020.04/mongoose/mongoose.c:14507:15: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (remote) memcpy(sa, &nc->sa, sizeof(*sa)); data/swupdate-2020.04/mongoose/mongoose.c:14665: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). pf = fopen(pem_file, "r"); data/swupdate-2020.04/mongoose/mongoose.c:14669: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). df = fopen(der_file, "w"); data/swupdate-2020.04/mongoose/mongoose.c:14673:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char pem_buf[70]; data/swupdate-2020.04/mongoose/mongoose.c:14674:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char der_buf[48]; data/swupdate-2020.04/mongoose/mongoose.c:14898: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((dst)->sin6.sin6_addr.s6_addr, (src)->ip6.addr, \ data/swupdate-2020.04/mongoose/mongoose.c:15418:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->payload, data, len); data/swupdate-2020.04/mongoose/mongoose.c:15538:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sa, &nc->sa, sizeof(*sa)); data/swupdate-2020.04/mongoose/mongoose.c:15546:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sa, &nc->sa, sizeof(*sa)); data/swupdate-2020.04/mongoose/mongoose.c:15758:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[10]; data/swupdate-2020.04/mongoose/mongoose.c:15763:5: [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). int open(const char *filename, int oflag, int pmode) { data/swupdate-2020.04/mongoose/mongoose.c:15919: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(&nc->sa, sa, sizeof(*sa)); data/swupdate-2020.04/mongoose/mongoose.c:15959:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char addr[17]; data/swupdate-2020.04/mongoose/mongoose.h:1746:5: [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). int open(const char *filename, int oflag, int pmode); data/swupdate-2020.04/mongoose/mongoose.h:2155: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 in[64]; data/swupdate-2020.04/mongoose/mongoose.h:2205: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 buffer[64]; data/swupdate-2020.04/mongoose/mongoose.h:2210:29: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void cs_sha1_final(unsigned char digest[20], cs_sha1_ctx *); data/swupdate-2020.04/mongoose/mongoose.h:2211:34: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. void cs_hmac_sha1(const unsigned char *key, size_t key_len, data/swupdate-2020.04/mongoose/mongoose.h:2212:34: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const unsigned char *text, size_t text_len, data/swupdate-2020.04/mongoose/mongoose.h:2213:28: [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[20]); data/swupdate-2020.04/mongoose/mongoose.h:2531: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 chunk[3]; data/swupdate-2020.04/mongoose/mongoose_interface.c:156:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char text[4096]; data/swupdate-2020.04/mongoose/mongoose_interface.c:157:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[4160]; data/swupdate-2020.04/mongoose/mongoose_interface.c:191: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 str[512]; data/swupdate-2020.04/mongoose/mongoose_interface.c:403: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 tmp[128]; data/swupdate-2020.04/parser/parse_external.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 seek_str[MAX_SEEK_STRING_SIZE]; data/swupdate-2020.04/parser/parser.c:207: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[SWUPDATE_GENERAL_STRING_SIZE]; data/swupdate-2020.04/parser/parser.c:265: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 seek_str[MAX_SEEK_STRING_SIZE]; data/swupdate-2020.04/parser/parser.c:417:4: [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(script->type, "lua"); data/swupdate-2020.04/parser/parser.c:568:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(image->type, "ubivol"); data/swupdate-2020.04/parser/parser.c:570:5: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(image->type, "raw"); data/swupdate-2020.04/parser/parser.c:649:4: [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(file->type, "rawfile"); data/swupdate-2020.04/parser/parser.c:795: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(filename, O_RDONLY); data/swupdate-2020.04/scripts/basic/fixdep.c:145: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[0]; data/swupdate-2020.04/scripts/basic/fixdep.c:187: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(aux->name, name, len); data/swupdate-2020.04/scripts/basic/fixdep.c:287: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(filename, O_RDONLY); data/swupdate-2020.04/scripts/basic/fixdep.c:322: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[PATH_MAX]; data/swupdate-2020.04/scripts/basic/fixdep.c:330: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, m, p-m); s[p-m] = 0; data/swupdate-2020.04/scripts/basic/fixdep.c:345: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, m, p-m); s[p-m] = 0; data/swupdate-2020.04/scripts/basic/fixdep.c:375: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(depfile, O_RDONLY); data/swupdate-2020.04/scripts/kconfig/conf.c:44: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/swupdate-2020.04/scripts/kconfig/conf.c:323: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/swupdate-2020.04/scripts/kconfig/confdata.c:88: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/swupdate-2020.04/scripts/kconfig/confdata.c:89: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/swupdate-2020.04/scripts/kconfig/confdata.c:113: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/swupdate-2020.04/scripts/kconfig/confdata.c:653: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/swupdate-2020.04/scripts/kconfig/confdata.c:674: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/swupdate-2020.04/scripts/kconfig/confdata.c:748: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/swupdate-2020.04/scripts/kconfig/confdata.c:762: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/swupdate-2020.04/scripts/kconfig/confdata.c:777: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/swupdate-2020.04/scripts/kconfig/confdata.c:780: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/swupdate-2020.04/scripts/kconfig/confdata.c:828: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/swupdate-2020.04/scripts/kconfig/confdata.c:844: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/swupdate-2020.04/scripts/kconfig/confdata.c:915: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/swupdate-2020.04/scripts/kconfig/confdata.c:918: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/swupdate-2020.04/scripts/kconfig/confdata.c:938: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/swupdate-2020.04/scripts/kconfig/confdata.c:967: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/swupdate-2020.04/scripts/kconfig/confdata.c:971: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/swupdate-2020.04/scripts/kconfig/confdata.c:977: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/swupdate-2020.04/scripts/kconfig/expr.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(e, org, sizeof(*org)); data/swupdate-2020.04/scripts/kconfig/expr.c:1153: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/swupdate-2020.04/scripts/kconfig/expr.c:1154: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/swupdate-2020.04/scripts/kconfig/gconf.c:84:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buf[256]; data/swupdate-2020.04/scripts/kconfig/gconf.c:89: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(buf, "const/"); data/swupdate-2020.04/scripts/kconfig/gconf.c:91: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(buf, "check/"); data/swupdate-2020.04/scripts/kconfig/gconf.c:93: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(buf, "choice/"); data/swupdate-2020.04/scripts/kconfig/gconf.c:95: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(buf, "choiceval/"); data/swupdate-2020.04/scripts/kconfig/gconf.c:97: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(buf, "valid/"); data/swupdate-2020.04/scripts/kconfig/gconf.c:99: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(buf, "optional/"); data/swupdate-2020.04/scripts/kconfig/gconf.c:101: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(buf, "write/"); data/swupdate-2020.04/scripts/kconfig/gconf.c:103: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(buf, "changed/"); data/swupdate-2020.04/scripts/kconfig/gconf.c:105: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(buf, "auto/"); data/swupdate-2020.04/scripts/kconfig/gconf.c:1168:44: [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. pix = gdk_pixbuf_new_from_xpm_data((const char **) data/swupdate-2020.04/scripts/kconfig/gconf.c:1229: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(&found, child, sizeof(GtkTreeIter)); data/swupdate-2020.04/scripts/kconfig/gconf.c:1286: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, child2, sizeof(GtkTreeIter)); data/swupdate-2020.04/scripts/kconfig/gconf.c:1311: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, child2, sizeof(GtkTreeIter)); data/swupdate-2020.04/scripts/kconfig/kxgettext.c:153: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 bf[16384]; data/swupdate-2020.04/scripts/kconfig/lxdialog/dialog.h:173: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[MAXITEMSTR]; /* prompt displayed */ data/swupdate-2020.04/scripts/kconfig/lxdialog/inputbox.c:24:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dialog_input_result[MAX_LEN + 1]; data/swupdate-2020.04/scripts/kconfig/lxdialog/textbox.c:372: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 line[MAX_LEN + 1]; data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:386: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 tempstr[MAX_LEN + 1], *word, *sp, *sp2, *newline_separator = 0; data/swupdate-2020.04/scripts/kconfig/mconf.c:296: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 filename[PATH_MAX+1]; data/swupdate-2020.04/scripts/kconfig/mconf.c:299: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 menu_backtitle[PATH_MAX+128]; data/swupdate-2020.04/scripts/kconfig/mconf.c:372:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char header[4]; data/swupdate-2020.04/scripts/kconfig/mconf.c:377:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(header, "(%c)", key); data/swupdate-2020.04/scripts/kconfig/mconf.c:382:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(header, " "); data/swupdate-2020.04/scripts/kconfig/mconf.c:385:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf + pos->offset, header, sizeof(header) - 1); data/swupdate-2020.04/scripts/kconfig/mconf.c:778:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX+1]; data/swupdate-2020.04/scripts/kconfig/nconf.c:248: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[256]; data/swupdate-2020.04/scripts/kconfig/nconf.c:546: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(k_menu_items[items_num].str, "XXX", 3); data/swupdate-2020.04/scripts/kconfig/nconf.c:567: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 new_str[256]; data/swupdate-2020.04/scripts/kconfig/nconf.c:568: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 tmp_str[256]; data/swupdate-2020.04/scripts/kconfig/nconf.c:626: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 filename[PATH_MAX+1]; data/swupdate-2020.04/scripts/kconfig/nconf.c:627: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 menu_backtitle[PATH_MAX+128]; data/swupdate-2020.04/scripts/kconfig/nconf.c:1012: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 pattern[256]; data/swupdate-2020.04/scripts/kconfig/nconf.c:1213: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[1024]; data/swupdate-2020.04/scripts/kconfig/nconf.gui.c:224: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 tmp[x+10]; data/swupdate-2020.04/scripts/kconfig/qconf.cc:932:34: [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). void ConfigList::setAllOpen(bool open) data/swupdate-2020.04/scripts/kconfig/qconf.cc:937:25: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). it.current()->setOpen(open); data/swupdate-2020.04/scripts/kconfig/qconf.cc:1280: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 title[256]; data/swupdate-2020.04/scripts/kconfig/qconf.h:117:23: [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). void setAllOpen(bool open); data/swupdate-2020.04/scripts/kconfig/symbol.c:160: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/swupdate-2020.04/scripts/kconfig/symbol.c:183: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, "%lld", val2); data/swupdate-2020.04/scripts/kconfig/symbol.c:185: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%llx", val2); data/swupdate-2020.04/scripts/kconfig/symbol.c:882: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/swupdate-2020.04/scripts/kconfig/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/swupdate-2020.04/scripts/kconfig/util.c:118: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/swupdate-2020.04/suricatta/common.c:21: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 tmp[128]; data/swupdate-2020.04/suricatta/server_general.c:134: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 event[80], fmt[80]; data/swupdate-2020.04/suricatta/server_general.c:261:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (channel->open(channel, &channel_data) != CHANNEL_OK) { data/swupdate-2020.04/suricatta/server_general.c:575: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 tmp[128]; data/swupdate-2020.04/suricatta/server_general.c:662:30: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (server_general.channel->open(server_general.channel, &channel_data_defaults) != CHANNEL_OK) { data/swupdate-2020.04/suricatta/server_hawkbit.c:304: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 fdate[15 + 1]; data/swupdate-2020.04/suricatta/server_hawkbit.c:415: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 fdate[15 + 1]; data/swupdate-2020.04/suricatta/server_hawkbit.c:679:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (channel->open(channel, &channel_data_defaults) != CHANNEL_OK) { data/swupdate-2020.04/suricatta/server_hawkbit.c:910:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *details[MAX_DETAILS]; data/swupdate-2020.04/suricatta/server_hawkbit.c:923:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (channel->open(channel, &channel_data) != CHANNEL_OK) { data/swupdate-2020.04/suricatta/server_hawkbit.c:1522: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 fdate[15 + 1]; data/swupdate-2020.04/suricatta/server_hawkbit.c:1595: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 tmp[128]; data/swupdate-2020.04/suricatta/server_hawkbit.c:1790:30: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (server_hawkbit.channel->open(server_hawkbit.channel, &channel_data_defaults) != CHANNEL_OK) { data/swupdate-2020.04/suricatta/server_hawkbit.h:39: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 *errors[HAWKBIT_MAX_REPORTED_ERRORS]; data/swupdate-2020.04/test/test_server_hawkbit.c:300:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char *details[1] = { "UNIT TEST" }; data/swupdate-2020.04/tools/swupdate-client.c:49:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[256]; data/swupdate-2020.04/tools/swupdate-client.c:120:24: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (filename && (fd = open(filename, O_RDONLY)) < 0) { data/swupdate-2020.04/tools/swupdate-progress.c:53: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 command[13]; data/swupdate-2020.04/tools/swupdate-progress.c:56: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(command, "%c[%d;%d;%dm", 0x1B, attr, fg + 30, bg + 40); data/swupdate-2020.04/tools/swupdate-progress.c:92:25: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((psplash_pipe_fd = open(pipe, O_WRONLY | O_NONBLOCK)) == -1) { data/swupdate-2020.04/tools/swupdate-progress.c:102:27: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((psplash_pipe_fd = open(pipe, O_WRONLY | O_NONBLOCK)) == -1) { data/swupdate-2020.04/tools/swupdate-progress.c:117:25: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((psplash_pipe_fd = open(pipe, O_WRONLY | O_NONBLOCK)) == -1) { data/swupdate-2020.04/tools/swupdate-progress.c:178: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 psplash_pipe_path[256]; data/swupdate-2020.04/tools/swupdate-progress.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 bar[60]; data/swupdate-2020.04/tools/swupdate-sysrestart.c:38: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 ipaddrs[MAX_DEVS][NI_MAXHOST]; data/swupdate-2020.04/tools/swupdate-sysrestart.c:70: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 url[NI_MAXHOST + 20]; data/swupdate-2020.04/tools/swupdate-sysrestart.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 local[NI_MAXHOST]; data/swupdate-2020.04/bootloader/ebg.c:48: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). if (strncmp(name, RCS_KEY, strlen(name) + 1) == 0 && data/swupdate-2020.04/bootloader/ebg.c:49:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strncmp(value, RCS_VALUE, strlen(RCS_VALUE) + 1) == 0) { data/swupdate-2020.04/bootloader/ebg.c:57:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). } else if (strncmp(name, (char *)STATE_KEY, strlen((char *)STATE_KEY) + 1) == 0) { data/swupdate-2020.04/bootloader/ebg.c:92: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). if (strncmp(name, RCS_KEY, strlen(name) + 1) == 0) { data/swupdate-2020.04/bootloader/ebg.c:120:39: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strncmp(name, (char *)STATE_KEY, strlen((char *)STATE_KEY) + 1) == 0) { data/swupdate-2020.04/bootloader/grub.c:61: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(buf, GRUBENV_HEADER, strlen(GRUBENV_HEADER) -1)) { data/swupdate-2020.04/bootloader/grub.c:159:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size = size + strlen(key) + strlen(value) + 2; data/swupdate-2020.04/bootloader/grub.c:159: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). size = size + strlen(key) + strlen(value) + 2; data/swupdate-2020.04/bootloader/grub.c:161: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). size += strlen(GRUBENV_HEADER); data/swupdate-2020.04/bootloader/grub.c:196:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, GRUBENV_HEADER, strlen(GRUBENV_HEADER) + 1); data/swupdate-2020.04/bootloader/grub.c:196: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). strncpy(buf, GRUBENV_HEADER, strlen(GRUBENV_HEADER) + 1); data/swupdate-2020.04/bootloader/grub.c:203: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). llen = strlen(key) + strlen(value) + 2; data/swupdate-2020.04/bootloader/grub.c:203: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). llen = strlen(key) + strlen(value) + 2; data/swupdate-2020.04/bootloader/grub.c:210:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(buf, tmp, llen); data/swupdate-2020.04/core/cpio_utils.c:60:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd, buf, nbytes); data/swupdate-2020.04/core/cpio_utils.c:101:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fd, buf, padding); data/swupdate-2020.04/core/cpio_utils.c:452:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (imgivt && strlen(imgivt) && !ascii_to_bin(ivtbuf, imgivt, sizeof(ivtbuf))) { data/swupdate-2020.04/core/cpio_utils.c:696:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((strlen(TMPDIR) + strlen(fdh.filename)) > sizeof(output_file)) { data/swupdate-2020.04/core/cpio_utils.c:696: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). if ((strlen(TMPDIR) + strlen(fdh.filename)) > sizeof(output_file)) { data/swupdate-2020.04/core/handler.c:60: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(img->type) == strlen(supported_types[i].desc)) && data/swupdate-2020.04/core/handler.c:60: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). if ((strlen(img->type) == strlen(supported_types[i].desc)) && data/swupdate-2020.04/core/installer.c:181:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) { data/swupdate-2020.04/core/installer.c:181:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) { data/swupdate-2020.04/core/installer.c:328: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(img->path) > 0) && data/swupdate-2020.04/core/installer.c:329:5: [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(img->extract_file) > 0) && data/swupdate-2020.04/core/installer.c:372: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). char* bootscript = alloca(strlen(TMPDIR)+strlen(BOOT_SCRIPT_SUFFIX)+1); data/swupdate-2020.04/core/installer.c:372:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* bootscript = alloca(strlen(TMPDIR)+strlen(BOOT_SCRIPT_SUFFIX)+1); data/swupdate-2020.04/core/network_thread.c:69: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). int len = msg ? strlen(msg) : 0; data/swupdate-2020.04/core/network_thread.c:91:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(newmsg->msg, msg, len); data/swupdate-2020.04/core/network_thread.c:184:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, &msg, sizeof(msg)) < 0) data/swupdate-2020.04/core/network_thread.c:247:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nread = read(ctrlconnfd, (void *)&msg, sizeof(msg)); data/swupdate-2020.04/core/network_thread.c:331:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(pipe, &msg, sizeof(msg)); data/swupdate-2020.04/core/network_thread.c:391:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(msg.data.status.desc, notification->msg, data/swupdate-2020.04/core/notifier.c:126:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(current, "No SWUPDATE running : ", sizeof(current)); data/swupdate-2020.04/core/notifier.c:129:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(current, "SWUPDATE downloading : ", sizeof(current)); data/swupdate-2020.04/core/notifier.c:132:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(current, "SWUPDATE started : ", sizeof(current)); data/swupdate-2020.04/core/notifier.c:135:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(current, "SWUPDATE running : ", sizeof(current)); data/swupdate-2020.04/core/notifier.c:138:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(current, "SWUPDATE successful !", sizeof(current)); data/swupdate-2020.04/core/notifier.c:154:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(current, "SWUPDATE done : ", sizeof(current)); data/swupdate-2020.04/core/notifier.c:267:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(addr->sun_path, CONFIG_SOCKET_NOTIFIER_DIRECTORY, sizeof(addr->sun_path)); data/swupdate-2020.04/core/notifier.c:268:2: [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(addr->sun_path, path, data/swupdate-2020.04/core/notifier.c:269: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). sizeof(addr->sun_path)-strlen(CONFIG_SOCKET_NOTIFIER_DIRECTORY)); data/swupdate-2020.04/core/notifier.c:299: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). int len_socket_name = strlen(¬ify_server.sun_path[1]); data/swupdate-2020.04/core/parser.c:141:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(img->id.name) || !strlen(img->id.version) || data/swupdate-2020.04/core/parser.c:141:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(img->id.name) || !strlen(img->id.version) || data/swupdate-2020.04/core/parser.c:170:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(img->id.name) || !strlen(img->id.version) || data/swupdate-2020.04/core/parser.c:170:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(img->id.name) || !strlen(img->id.version) || data/swupdate-2020.04/core/parser.c:234: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). sigfile = malloc(strlen(descfile) + strlen(".sig") + 1); data/swupdate-2020.04/core/parser.c:234:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sigfile = malloc(strlen(descfile) + strlen(".sig") + 1); data/swupdate-2020.04/core/parsing_library.c:119:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(d, s, n); data/swupdate-2020.04/core/parsing_library.c:213:42: [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 (!newpath || (newpath[0] != '#') || (strlen(newpath) < 3)) data/swupdate-2020.04/core/parsing_library.c:219: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). strlen(newpath) + 1); data/swupdate-2020.04/core/parsing_library.c:256: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). strlen(newpath) + 1); data/swupdate-2020.04/core/pctl.c:325:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read(fds[i], &pbuf[c], SWUPDATE_GENERAL_STRING_SIZE - c); data/swupdate-2020.04/core/progress_thread.c:155: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). prbar->msg.infolen = strlen(prbar->msg.info); data/swupdate-2020.04/core/progress_thread.c:169: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). prbar->msg.infolen = strlen(prbar->msg.info); data/swupdate-2020.04/core/stream_interface.c:327:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fdin, buf, maxread); data/swupdate-2020.04/core/stream_interface.c:386:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(fdin, buf, bufsize); data/swupdate-2020.04/core/stream_interface.c:514:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(software->output)) { data/swupdate-2020.04/core/swupdate.c:220:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(hw->boardname) || !strlen(hw->revision)) data/swupdate-2020.04/core/swupdate.c:220: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). if (!strlen(hw->boardname) || !strlen(hw->revision)) data/swupdate-2020.04/core/swupdate.c:258: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). !strlen(dp->d_name)) data/swupdate-2020.04/core/swupdate.c:265: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). buf = (char *)malloc(3 * strlen(dp->d_name) + 1); data/swupdate-2020.04/core/swupdate.c:267:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). for (size_t i = 0; i < strlen(dp->d_name); i++) { data/swupdate-2020.04/core/swupdate.c:271:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buf[3 * strlen(dp->d_name)] = '\0'; data/swupdate-2020.04/core/swupdate.c:303:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(fname)) { data/swupdate-2020.04/core/swupdate.c:331:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* swdescfilename = alloca(strlen(get_tmpdir())+strlen(SW_DESCRIPTION_FILENAME)+1); data/swupdate-2020.04/core/swupdate.c:331:53: [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). char* swdescfilename = alloca(strlen(get_tmpdir())+strlen(SW_DESCRIPTION_FILENAME)+1); data/swupdate-2020.04/core/swupdate.c:421: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(sw->software_set) == 0 || strlen(sw->running_mode) == 0) data/swupdate-2020.04/core/swupdate.c:421:39: [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(sw->software_set) == 0 || strlen(sw->running_mode) == 0) data/swupdate-2020.04/core/swupdate.c:538: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(sw->globals.minimum_version)) data/swupdate-2020.04/core/swupdate.c:542: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(sw->globals.current_version)) data/swupdate-2020.04/core/swupdate.c:884: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 (public_key_mandatory && !strlen(swcfg.globals.publickeyfname)) { data/swupdate-2020.04/core/swupdate.c:898: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 (opt_i && strlen(swcfg.output)) { data/swupdate-2020.04/core/swupdate.c:914: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(swcfg.globals.publickeyfname)) { data/swupdate-2020.04/core/swupdate.c:983: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(swcfg.globals.mtdblacklist)) data/swupdate-2020.04/core/swupdate.c:991: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(swcfg.globals.aeskeyfname)) { data/swupdate-2020.04/core/util.c:44: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). if ((p = (char *) malloc(strlen(str) + 1)) != NULL) { data/swupdate-2020.04/core/util.c:68: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(s) == len) { data/swupdate-2020.04/core/util.c:111:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (env_tmpdir[strlen(env_tmpdir)] == '/') { data/swupdate-2020.04/core/util.c:205:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (len > strlen(src)) data/swupdate-2020.04/core/util.c:206: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). len = strlen(src); data/swupdate-2020.04/core/util.c:267: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(dir) == 1 && dir[0] == '/') data/swupdate-2020.04/core/util.c:301: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(hw->boardname)) data/swupdate-2020.04/core/util.c:325:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((strlen(b1) > (SWUPDATE_GENERAL_STRING_SIZE) - 1) || data/swupdate-2020.04/core/util.c:326:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (strlen(b2) > (SWUPDATE_GENERAL_STRING_SIZE - 1))) { data/swupdate-2020.04/core/util.c:358: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). prefix_len = strlen(HWID_REGEXP_PREFIX); data/swupdate-2020.04/core/util.c:626: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). count += last_delim < (s + strlen(s) - 1); data/swupdate-2020.04/core/util.c:725: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). iov[0].iov_len = strlen("fstype") + 1; data/swupdate-2020.04/core/util.c:727: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). iov[1].iov_len = strlen(fstype) + 1; data/swupdate-2020.04/core/util.c:729: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). iov[2].iov_len = strlen("fspath") + 1; data/swupdate-2020.04/core/util.c:731: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). iov[3].iov_len = strlen(dir) + 1; data/swupdate-2020.04/core/util.c:733: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). iov[4].iov_len = strlen("from") + 1; data/swupdate-2020.04/core/util.c:735: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). iov[5].iov_len = strlen(device) + 1; data/swupdate-2020.04/core/util.c:740: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). iov[6].iov_len = strlen("errmsg") + 1; data/swupdate-2020.04/core/util.c:742: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). iov[7].iov_len = strlen(errmsg) + 1; data/swupdate-2020.04/core/util.c:799: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). buf[strlen(buf) - 2] = '\0'; data/swupdate-2020.04/corelib/channel_curl.c:442: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). if (channel_data->content_type && strlen(channel_data->content_type)) data/swupdate-2020.04/corelib/channel_curl.c:707: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). bytes = strlen(channel_data->request_body) - channel_data->offs; data/swupdate-2020.04/corelib/channel_curl.c:803:21: [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). (curl_off_t)strlen(channel_data->request_body)) != CURLE_OK) || data/swupdate-2020.04/corelib/channel_curl.c:899:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). channel_data->info == NULL ? 0 : strlen(channel_data->info), data/swupdate-2020.04/corelib/downloader.c:69:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) { data/swupdate-2020.04/corelib/downloader.c:74:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) { data/swupdate-2020.04/corelib/lua_interface.c:261:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(img->id.name, value, data/swupdate-2020.04/corelib/lua_interface.c:265:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(img->id.version, value, data/swupdate-2020.04/corelib/lua_interface.c:269:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(img->fname, value, data/swupdate-2020.04/corelib/lua_interface.c:273:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(img->volname, value, data/swupdate-2020.04/corelib/lua_interface.c:276:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(img->type, value, data/swupdate-2020.04/corelib/lua_interface.c:279:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(img->device, value, data/swupdate-2020.04/corelib/lua_interface.c:282:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(img->path, value, data/swupdate-2020.04/corelib/lua_interface.c:285:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(img->path, value, data/swupdate-2020.04/corelib/lua_interface.c:288:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(img->type_data, value, data/swupdate-2020.04/corelib/lua_interface.c:291:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(img->filesystem, value, data/swupdate-2020.04/corelib/lua_interface.c:296:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(img->ivt_ascii, value, data/swupdate-2020.04/corelib/lua_interface.c:300:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(seek_str, value, data/swupdate-2020.04/corelib/lua_interface.c:672: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). if (msg && strlen(msg)) data/swupdate-2020.04/corelib/lua_interface.c:741: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). if (!device || !strlen(device) || !filesystem || !strlen(filesystem)) data/swupdate-2020.04/corelib/lua_interface.c:741:52: [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 (!device || !strlen(device) || !filesystem || !strlen(filesystem)) data/swupdate-2020.04/corelib/lua_interface.c:806:14: [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 (name && strlen(name)) data/swupdate-2020.04/corelib/lua_interface.c:821:14: [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 (name && strlen(name)) data/swupdate-2020.04/corelib/mtd-interface.c:420: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(mtd_ubi_blacklist)) data/swupdate-2020.04/corelib/swupdate_cms_verify.c:130:16: [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_t len = strlen(name); data/swupdate-2020.04/corelib/swupdate_rsa_verify_mbedtls.c:57:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rd = read(fd, buffer, size); data/swupdate-2020.04/handlers/archive_handler.c:204: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). int use_mount = (strlen(img->device) && strlen(img->filesystem)) ? 1 : 0; data/swupdate-2020.04/handlers/archive_handler.c:204:42: [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 use_mount = (strlen(img->device) && strlen(img->filesystem)) ? 1 : 0; data/swupdate-2020.04/handlers/archive_handler.c:210: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(img->path) == 0) { data/swupdate-2020.04/handlers/boot_handler.c:77:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(buf); data/swupdate-2020.04/handlers/diskpart_handler.c:118:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!strlen(img->device)) { data/swupdate-2020.04/handlers/diskpart_handler.c:142: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). "partition-", strlen("partition-"))) data/swupdate-2020.04/handlers/diskpart_handler.c:153:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). part->partno = strtoul(entry->key + strlen("partition-"), NULL, 10); data/swupdate-2020.04/handlers/diskpart_handler.c:156: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/swupdate-2020.04/handlers/diskpart_handler.c:158:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!((equal - elem->value) == strlen(fields[i]) && data/swupdate-2020.04/handlers/diskpart_handler.c:159:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). !strncmp(elem->value, fields[i], strlen(fields[i])))) data/swupdate-2020.04/handlers/diskpart_handler.c:164:30: [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. part->size = ustrtoull(equal, 10); data/swupdate-2020.04/handlers/diskpart_handler.c:167:31: [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. part->start = ustrtoull(equal, 10); data/swupdate-2020.04/handlers/diskpart_handler.c:170:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(part->type, equal, sizeof(part->type)); data/swupdate-2020.04/handlers/diskpart_handler.c:170:27: [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. strncpy(part->type, equal, sizeof(part->type)); data/swupdate-2020.04/handlers/diskpart_handler.c:173:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(part->name, equal, sizeof(part->name)); data/swupdate-2020.04/handlers/diskpart_handler.c:173:27: [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. strncpy(part->name, equal, sizeof(part->name)); data/swupdate-2020.04/handlers/flash_hamming1_handler.c:221:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cnt = read(fd, page, min(mtd->min_io_size, imglen)); data/swupdate-2020.04/handlers/flash_hamming1_handler.c:284: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(img->path)) data/swupdate-2020.04/handlers/flash_hamming1_handler.c:290:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(img->path) ? img->path : img->device); data/swupdate-2020.04/handlers/flash_handler.c:193:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). cnt = read(ifd, writebuf + tinycnt, readlen - tinycnt); data/swupdate-2020.04/handlers/flash_handler.c:330: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(img->path)) data/swupdate-2020.04/handlers/flash_handler.c:336:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(img->path) ? img->path : img->device); data/swupdate-2020.04/handlers/lua_scripthandler.c:35: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). char filename[MAX_IMAGE_FNAME + strlen(tmp) + 2 + strlen(img->type_data)]; data/swupdate-2020.04/handlers/lua_scripthandler.c:35:52: [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). char filename[MAX_IMAGE_FNAME + strlen(tmp) + 2 + strlen(img->type_data)]; data/swupdate-2020.04/handlers/raw_handler.c:81:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret_ss = read(fd_force_ro, ¤t_prot, 1); data/swupdate-2020.04/handlers/raw_handler.c:198: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). int use_mount = (strlen(img->device) && strlen(img->filesystem)) ? 1 : 0; data/swupdate-2020.04/handlers/raw_handler.c:198:42: [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 use_mount = (strlen(img->device) && strlen(img->filesystem)) ? 1 : 0; data/swupdate-2020.04/handlers/raw_handler.c:199: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). char* DATADST_DIR = alloca(strlen(get_tmpdir())+strlen(DATADST_DIR_SUFFIX)+1); data/swupdate-2020.04/handlers/raw_handler.c:199:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char* DATADST_DIR = alloca(strlen(get_tmpdir())+strlen(DATADST_DIR_SUFFIX)+1); data/swupdate-2020.04/handlers/raw_handler.c:203: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(img->path) == 0) { data/swupdate-2020.04/handlers/rdiff_handler.c:231: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). bool use_mount = (strlen(img->device) && strlen(img->filesystem)) ? true : false; data/swupdate-2020.04/handlers/rdiff_handler.c:231: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). bool use_mount = (strlen(img->device) && strlen(img->filesystem)) ? true : false; data/swupdate-2020.04/handlers/rdiff_handler.c:260:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(img->path) == 0) { data/swupdate-2020.04/handlers/rdiff_handler.c:284: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). mountpoint = alloca(strlen(get_tmpdir()) + strlen(DATADST_DIR_SUFFIX) + 1); data/swupdate-2020.04/handlers/rdiff_handler.c:284:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). mountpoint = alloca(strlen(get_tmpdir()) + strlen(DATADST_DIR_SUFFIX) + 1); data/swupdate-2020.04/handlers/rdiff_handler.c:294:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). base_file_filename = alloca(strlen(mountpoint) + strlen(img->path) + 1); data/swupdate-2020.04/handlers/rdiff_handler.c:294:53: [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). base_file_filename = alloca(strlen(mountpoint) + strlen(img->path) + 1); data/swupdate-2020.04/handlers/rdiff_handler.c:388:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((r = read(fileno(rdiff_state.dest_file), buf, DFLTPHYS)) > 0) { data/swupdate-2020.04/handlers/remote_handler.c:43: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). zmq_msg_init_size (msg, strlen(key)); data/swupdate-2020.04/handlers/remote_handler.c:44:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy (zmq_msg_data (msg), key, strlen(key)); data/swupdate-2020.04/handlers/remote_handler.c:162:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(img->type_data) + strlen(CONFIG_SOCKET_REMOTE_HANDLER_DIRECTORY) + strlen("ipc://") + 4; data/swupdate-2020.04/handlers/remote_handler.c:162: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). len = strlen(img->type_data) + strlen(CONFIG_SOCKET_REMOTE_HANDLER_DIRECTORY) + strlen("ipc://") + 4; data/swupdate-2020.04/handlers/remote_handler.c:162:82: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(img->type_data) + strlen(CONFIG_SOCKET_REMOTE_HANDLER_DIRECTORY) + strlen("ipc://") + 4; data/swupdate-2020.04/handlers/shell_scripthandler.c:33:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). char shellscript[MAX_IMAGE_FNAME + strlen(tmp) + data/swupdate-2020.04/handlers/shell_scripthandler.c:34: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). strlen("postinst") + 2]; data/swupdate-2020.04/handlers/ssbl_handler.c:115:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(p, property->value, MAX_VOLNAME); data/swupdate-2020.04/handlers/ssbl_handler.c:225:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, &pssbl->ssbl, sizeof(struct ssbl_admin_sector)); data/swupdate-2020.04/handlers/swuforward_handler.c:72:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). nbytes = read(conn->fifo[0], buffer, nbytes); data/swupdate-2020.04/handlers/swuforward_handler.c:192: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). posturl = (char *)alloca(strlen(conn->url) + strlen(POST_URL_V2) + 1); data/swupdate-2020.04/handlers/swuforward_handler.c:192:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). posturl = (char *)alloca(strlen(conn->url) + strlen(POST_URL_V2) + 1); data/swupdate-2020.04/handlers/ubivol_handler.c:119: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). rnvol.ents[0].name_len = strlen(vol2->name); data/swupdate-2020.04/handlers/ubivol_handler.c:123: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). rnvol.ents[1].name_len = strlen(vol1->name); data/swupdate-2020.04/handlers/ubivol_handler.c:567:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). rnvol.ents[2 * count + 0].name_len = min(strlen(name[1]), UBI_MAX_VOLUME_NAME); data/swupdate-2020.04/handlers/ubivol_handler.c:572:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). rnvol.ents[2 * count + 1].name_len = min(strlen(name[0]), UBI_MAX_VOLUME_NAME); data/swupdate-2020.04/handlers/ucfw_handler.c:171:2: [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(20000); data/swupdate-2020.04/handlers/ucfw_handler.c:176:2: [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(20000); data/swupdate-2020.04/handlers/ucfw_handler.c:332:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, rx, size); data/swupdate-2020.04/handlers/ucfw_handler.c:376: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). len = insert_chksum(buf, strlen(buf)); data/swupdate-2020.04/include/compat.h:27:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). #define strdupa(s) strndupa(s, strlen(s)) data/swupdate-2020.04/ipc/network_ipc.c:29:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!SOCKET_CTRL_PATH || !strlen(SOCKET_CTRL_PATH)) { data/swupdate-2020.04/ipc/network_ipc.c:55:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(servaddr.sun_path, get_ctrl_socket(), sizeof(servaddr.sun_path) - 1); data/swupdate-2020.04/ipc/network_ipc.c:86:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(msg->data.instmsg.buf, tmpbuf, sizeof(msg->data.instmsg.buf) - 1); data/swupdate-2020.04/ipc/network_ipc.c:96:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(connfd, msg, sizeof(*msg)); data/swupdate-2020.04/ipc/network_ipc.c:120:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(connfd, msg, sizeof(*msg)); data/swupdate-2020.04/ipc/network_ipc.c:136:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(connfd, msg, sizeof(*msg)); data/swupdate-2020.04/ipc/network_ipc.c:216:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(connfd, &msg, sizeof(msg)); data/swupdate-2020.04/ipc/network_ipc.c:281:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(message.data.status.desc))) { data/swupdate-2020.04/ipc/network_ipc.c:309:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(connfd, msg, sizeof(*msg)); data/swupdate-2020.04/ipc/progress_ipc.c:27:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (!SOCKET_PROGRESS_PATH || !strlen(SOCKET_PROGRESS_PATH)) { data/swupdate-2020.04/ipc/progress_ipc.c:45:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(servaddr.sun_path, socketpath, sizeof(servaddr.sun_path) - 1); data/swupdate-2020.04/ipc/progress_ipc.c:62: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(10000); data/swupdate-2020.04/ipc/progress_ipc.c:79:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int ret = read(*connfd, msg, sizeof(*msg)); data/swupdate-2020.04/mongoose/mongoose.c:591:14: [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 = file + strlen(file); data/swupdate-2020.04/mongoose/mongoose.c:1541:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (s != NULL) ret.len = strlen(s); data/swupdate-2020.04/mongoose/mongoose.c:1553: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). size_t n2 = strlen(str2), n1 = str1->len; data/swupdate-2020.04/mongoose/mongoose.c:1563: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). size_t n2 = strlen(str2), n1 = str1->len; data/swupdate-2020.04/mongoose/mongoose.c:1904:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, path, sizeof(buf)); data/swupdate-2020.04/mongoose/mongoose.c:1908: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). p = buf + strlen(buf) - 1; data/swupdate-2020.04/mongoose/mongoose.c:1932: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). size_t find_length = strlen(find); data/swupdate-2020.04/mongoose/mongoose.c:1951:16: [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_t len = strlen(src) + 1; data/swupdate-2020.04/mongoose/mongoose.c:2186:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (str != NULL) s.len = strlen(str); data/swupdate-2020.04/mongoose/mongoose.c:2654:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). } else if (strlen(str) < host_len && data/swupdate-2020.04/mongoose/mongoose.c:4829: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). key_len = strlen(key_str); data/swupdate-2020.04/mongoose/mongoose.c:4849: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). ctx->identity_len = strlen(identity); data/swupdate-2020.04/mongoose/mongoose.c:4918: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). LOG(cs_level, ("%p %.*s", ctx, (int) (strlen(str) - 1), str)); data/swupdate-2020.04/mongoose/mongoose.c:5310:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). l = (e != NULL ? (e - s) : (int) strlen(s)); data/swupdate-2020.04/mongoose/mongoose.c:5311:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tmp, s, l); data/swupdate-2020.04/mongoose/mongoose.c:5340: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). key_len = strlen(key_str); data/swupdate-2020.04/mongoose/mongoose.c:5364:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(identity)) != 0) { data/swupdate-2020.04/mongoose/mongoose.c:5999:14: [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). path_len = strlen(path); data/swupdate-2020.04/mongoose/mongoose.c:6014: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). r.len = strlen(r.p); data/swupdate-2020.04/mongoose/mongoose.c:6020: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). r.len = strlen(r.p); data/swupdate-2020.04/mongoose/mongoose.c:6153: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). size_t i, len = strlen(name); data/swupdate-2020.04/mongoose/mongoose.c:6650: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). pd->mp_stream.boundary_len = strlen(boundary); data/swupdate-2020.04/mongoose/mongoose.c:7081: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). mg_send_head(nc, code, strlen(reason), data/swupdate-2020.04/mongoose/mongoose.c:7083: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). mg_send(nc, reason, strlen(reason)); data/swupdate-2020.04/mongoose/mongoose.c:7220:42: [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 (mg_match_prefix(opts->ssi_pattern, strlen(opts->ssi_pattern), path) > 0) { data/swupdate-2020.04/mongoose/mongoose.c:7279:16: [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). name_len = strlen(name); data/swupdate-2020.04/mongoose/mongoose.c:7365: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). int ch = ' ', ch1 = ',', ch2 = ';', n = strlen(var_name); data/swupdate-2020.04/mongoose/mongoose.c:7472:45: [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). (p1 != NULL && mg_match_prefix(p1, strlen(p1), path) == strlen(p1)) || data/swupdate-2020.04/mongoose/mongoose.c:7472:66: [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). (p1 != NULL && mg_match_prefix(p1, strlen(p1), path) == strlen(p1)) || data/swupdate-2020.04/mongoose/mongoose.c:7473:45: [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). (p2 != NULL && mg_match_prefix(p2, strlen(p2), path) > 0); data/swupdate-2020.04/mongoose/mongoose.c:7536: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). cs_md5(ha1, user, (size_t) strlen(user), colon, one, auth_domain, data/swupdate-2020.04/mongoose/mongoose.c:7537: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). (size_t) strlen(auth_domain), colon, one, passwd, data/swupdate-2020.04/mongoose/mongoose.c:7538: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). (size_t) strlen(passwd), NULL); data/swupdate-2020.04/mongoose/mongoose.c:7539: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). mg_mkmd5resp(method, strlen(method), uri, strlen(uri), ha1, sizeof(ha1) - 1, data/swupdate-2020.04/mongoose/mongoose.c:7539:45: [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). mg_mkmd5resp(method, strlen(method), uri, strlen(uri), ha1, sizeof(ha1) - 1, data/swupdate-2020.04/mongoose/mongoose.c:7540: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). nonce, strlen(nonce), "1", one, cnonce, strlen(cnonce), qop, data/swupdate-2020.04/mongoose/mongoose.c:7540:56: [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). nonce, strlen(nonce), "1", one, cnonce, strlen(cnonce), qop, data/swupdate-2020.04/mongoose/mongoose.c:7629:65: [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). mg_mkmd5resp(method.p, method.len, uri.p, uri.len, f_ha1, strlen(f_ha1), data/swupdate-2020.04/mongoose/mongoose.c:7634:48: [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 mg_ncasecmp(response.p, exp_resp, strlen(exp_resp)) == 0; data/swupdate-2020.04/mongoose/mongoose.c:7835:21: [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_t path_len = strlen(path); data/swupdate-2020.04/mongoose/mongoose.c:8061: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). root.len = strlen(opts->dav_document_root); data/swupdate-2020.04/mongoose/mongoose.c:8066: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). root.len = strlen(opts->document_root); data/swupdate-2020.04/mongoose/mongoose.c:8188:9: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (((sscanf(datetime, "%d/%3s/%d %d:%d:%d", &day, month_str, &year, &hour, data/swupdate-2020.04/mongoose/mongoose.c:8190:9: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. (sscanf(datetime, "%d %3s %d %d:%d:%d", &day, month_str, &year, &hour, data/swupdate-2020.04/mongoose/mongoose.c:8192:9: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. (sscanf(datetime, "%*3s, %d %3s %d %d:%d:%d", &day, month_str, &year, data/swupdate-2020.04/mongoose/mongoose.c:8194:9: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. (sscanf(datetime, "%d-%3s-%d %d:%d:%d", &day, month_str, &year, &hour, data/swupdate-2020.04/mongoose/mongoose.c:8265:48: [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). (mg_match_prefix(opts->cgi_file_pattern, strlen(opts->cgi_file_pattern), data/swupdate-2020.04/mongoose/mongoose.c:8647:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). (int) (path.p - host.p), host.p, strlen(post_data), (int) auth.len, data/swupdate-2020.04/mongoose/mongoose.c:8896:41: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). WideCharToMultiByte(CP_UTF8, 0, buf2, wcslen(buf2) + 1, abs_path, len, 0, 0); data/swupdate-2020.04/mongoose/mongoose.c:9010: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). send(1, buf, strlen(buf), 0); data/swupdate-2020.04/mongoose/mongoose.c:9351:21: [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). snprintf(path + strlen(path), sizeof(path) - strlen(path), "%s", file_name); data/swupdate-2020.04/mongoose/mongoose.c:9351:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). snprintf(path + strlen(path), sizeof(path) - strlen(path), "%s", file_name); data/swupdate-2020.04/mongoose/mongoose.c:9362:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (mg_match_prefix(opts->ssi_pattern, strlen(opts->ssi_pattern), path) > data/swupdate-2020.04/mongoose/mongoose.c:9410:16: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ch = fgetc(fp)) != EOF) { data/swupdate-2020.04/mongoose/mongoose.c:9827:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen((const char *) data); data/swupdate-2020.04/mongoose/mongoose.c:10437:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, inet_ntoa(sa->sin.sin_addr), len - 1); data/swupdate-2020.04/mongoose/mongoose.c:10450:21: [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 buf_len = strlen(buf); data/swupdate-2020.04/mongoose/mongoose.c:10458: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). return strlen(buf); data/swupdate-2020.04/mongoose/mongoose.c:10600:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). mbuf_append(buf, header_prefix, strlen(header_prefix)); data/swupdate-2020.04/mongoose/mongoose.c:10608:35: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). mbuf_append(buf, header_suffix, strlen(header_suffix)); data/swupdate-2020.04/mongoose/mongoose.c:10924:14: [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). id_len = strlen(client_id); data/swupdate-2020.04/mongoose/mongoose.c:10936:14: [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). wt_len = strlen(opts.will_topic); data/swupdate-2020.04/mongoose/mongoose.c:10937:14: [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). wm_len = strlen(opts.will_message); data/swupdate-2020.04/mongoose/mongoose.c:10948:16: [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). user_len = strlen(opts.user_name); data/swupdate-2020.04/mongoose/mongoose.c:10952:14: [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). pw_len = strlen(opts.password); data/swupdate-2020.04/mongoose/mongoose.c:10997: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). uint16_t topic_len = strlen(topic); data/swupdate-2020.04/mongoose/mongoose.c:11027: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). total_len += 2 + strlen(topics[i].topic) + 1; data/swupdate-2020.04/mongoose/mongoose.c:11036:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). topic_len = strlen(topics[i].topic); data/swupdate-2020.04/mongoose/mongoose.c:11067: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). total_len += 2 + strlen(topics[i]); data/swupdate-2020.04/mongoose/mongoose.c:11076:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). topic_len = strlen(topics[i]); data/swupdate-2020.04/mongoose/mongoose.c:11536:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (mg_dns_encode_record(&pkt, rr, name, strlen(name), NULL, 0) == -1) { data/swupdate-2020.04/mongoose/mongoose.c:11795:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (mg_dns_encode_record(reply->io, ans, name, strlen(name), rdata, data/swupdate-2020.04/mongoose/mongoose.c:12056:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(req->name, name, sizeof(req->name)); data/swupdate-2020.04/mongoose/mongoose.c:13841:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int read(int fd, char *buf, unsigned count) { data/swupdate-2020.04/mongoose/mongoose.c:13996: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). return (strlen(path) == 1 && *path == '.') ? 0 : ENOTDIR; data/swupdate-2020.04/mongoose/mongoose.c:14754: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). strlen(ssl_cert)); data/swupdate-2020.04/mongoose/mongoose.c:14761: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). strlen(ssl_key)); data/swupdate-2020.04/mongoose/mongoose.c:14778:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ssl_ca_cert, strlen(ssl_ca_cert)); data/swupdate-2020.04/mongoose/mongoose.c:14790:47: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ctx->ssl_server_name, strlen(ctx->ssl_server_name)); data/swupdate-2020.04/mongoose/mongoose.h:3929:34: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define MG_RECV_FUNC(s, b, l, f) read(s, b, l) data/swupdate-2020.04/mongoose/mongoose_interface.c:140:54: [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). mg_send_websocket_frame(nc, WEBSOCKET_OP_TEXT, buf, strlen(buf)); data/swupdate-2020.04/mongoose/mongoose_interface.c:145:45: [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). mg_broadcast(mgr, broadcast_callback, str, strlen(str) + 1); data/swupdate-2020.04/mongoose/mongoose_interface.c:154: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 (!ret && strlen(msg.data.status.desc) != 0) { data/swupdate-2020.04/mongoose/mongoose_interface.c:174: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(50 * 1000); data/swupdate-2020.04/mongoose/mongoose_interface.c:291:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). fus->fd = ipc_inst_start_ext(SOURCE_WEBSERVER, strlen(mp->file_name), mp->file_name, false); data/swupdate-2020.04/mongoose/mongoose_interface.c:336: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(100); data/swupdate-2020.04/mongoose/mongoose_interface.c:406:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) { data/swupdate-2020.04/mongoose/mongoose_interface.c:414:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) { data/swupdate-2020.04/mongoose/mongoose_interface.c:419:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) { data/swupdate-2020.04/mongoose/mongoose_interface.c:424:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) { data/swupdate-2020.04/mongoose/mongoose_interface.c:441:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) { data/swupdate-2020.04/mongoose/mongoose_interface.c:445:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) { data/swupdate-2020.04/parser/parser.c:30: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). #define NODEROOT (!strlen(CONFIG_PARSERROOT) ? \ data/swupdate-2020.04/parser/parser.c:69: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 (strlen(swcfg->running_mode) && strlen(swcfg->software_set) && data/swupdate-2020.04/parser/parser.c:69:46: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(swcfg->running_mode) && strlen(swcfg->software_set) && data/swupdate-2020.04/parser/parser.c:70: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). strlen(hardware->boardname)) { data/swupdate-2020.04/parser/parser.c:80: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(swcfg->running_mode) && strlen(swcfg->software_set)) { data/swupdate-2020.04/parser/parser.c:80:39: [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(swcfg->running_mode) && strlen(swcfg->software_set)) { data/swupdate-2020.04/parser/parser.c:89: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(hardware->boardname)) { data/swupdate-2020.04/parser/parser.c:163: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(swcfg->output)) { data/swupdate-2020.04/parser/parser.c:226: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(s)) data/swupdate-2020.04/parser/parser.c:349: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(partition->type)) data/swupdate-2020.04/parser/parser.c:355: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(partition->volname) && !strcmp(partition->type, "ubipartition")) || data/swupdate-2020.04/parser/parser.c:356: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). !strlen(partition->device)) { data/swupdate-2020.04/parser/parser.c:416: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(script->type)) { data/swupdate-2020.04/parser/parser.c:566: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(image->type)) { data/swupdate-2020.04/parser/parser.c:567: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(image->volname)) data/swupdate-2020.04/parser/parser.c:569: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). else if (strlen(image->device)) data/swupdate-2020.04/parser/parser.c:586:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(image->id.name) ? " " : "", image->id.name, data/swupdate-2020.04/parser/parser.c:587:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(image->id.version) ? " " : "", image->id.version, data/swupdate-2020.04/parser/parser.c:589:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(image->volname) ? "volume" : "device", data/swupdate-2020.04/parser/parser.c:590:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(image->volname) ? image->volname : data/swupdate-2020.04/parser/parser.c:591:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(image->path) ? image->path : image->device, data/swupdate-2020.04/parser/parser.c:592:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(image->type) ? image->type : "NOT FOUND", data/swupdate-2020.04/parser/parser.c:594:5: [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(image->id.name) && (image->id.install_if_different || data/swupdate-2020.04/parser/parser.c:648: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(file->type)) { data/swupdate-2020.04/parser/parser.c:665:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(file->id.name) ? " " : "", file->id.name, data/swupdate-2020.04/parser/parser.c:666:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(file->id.version) ? " " : "", file->id.version, data/swupdate-2020.04/parser/parser.c:669:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(file->device) ? file->device : "ROOTFS", data/swupdate-2020.04/parser/parser.c:670:5: [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(file->id.name) && file->id.install_if_different) ? data/swupdate-2020.04/parser/parser.c:801:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, string, size); data/swupdate-2020.04/scripts/basic/fixdep.c:272:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int slen = strlen(s); data/swupdate-2020.04/scripts/basic/fixdep.c:273: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). int sublen = strlen(sub); data/swupdate-2020.04/scripts/kconfig/conf.c:64: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/swupdate-2020.04/scripts/kconfig/conf.c:158: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/swupdate-2020.04/scripts/kconfig/conf.c:340: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/swupdate-2020.04/scripts/kconfig/confdata.c:94: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/swupdate-2020.04/scripts/kconfig/confdata.c:169: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/swupdate-2020.04/scripts/kconfig/confdata.c:223:11: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int c = getc(stream); data/swupdate-2020.04/scripts/kconfig/confdata.c:321: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/swupdate-2020.04/scripts/kconfig/confdata.c:323: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/swupdate-2020.04/scripts/kconfig/confdata.c:330: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/swupdate-2020.04/scripts/kconfig/confdata.c:336: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/swupdate-2020.04/scripts/kconfig/confdata.c:352: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/swupdate-2020.04/scripts/kconfig/confdata.c:353: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/swupdate-2020.04/scripts/kconfig/confdata.c:364: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/swupdate-2020.04/scripts/kconfig/confdata.c:370: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/swupdate-2020.04/scripts/kconfig/confdata.c:758: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/swupdate-2020.04/scripts/kconfig/expr.c:1165: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/swupdate-2020.04/scripts/kconfig/expr.c:1182: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/swupdate-2020.04/scripts/kconfig/expr.c:1187: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/swupdate-2020.04/scripts/kconfig/expr.c:1192: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/swupdate-2020.04/scripts/kconfig/gconf.c:107: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). buf[strlen(buf) - 1] = '\0'; data/swupdate-2020.04/scripts/kconfig/kxgettext.c:17:16: [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 textlen = strlen(text); data/swupdate-2020.04/scripts/kconfig/kxgettext.c:222:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(m->msg) > sizeof("\"\"")) data/swupdate-2020.04/scripts/kconfig/lxdialog/checklist.c:36:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(list_item, item_str(), list_width - item_x); data/swupdate-2020.04/scripts/kconfig/lxdialog/checklist.c:182: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). check_x = MAX(check_x, strlen(item_str()) + 4); data/swupdate-2020.04/scripts/kconfig/lxdialog/inputbox.c:101:8: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(instr); data/swupdate-2020.04/scripts/kconfig/lxdialog/menubox.c:72:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(menu_item, item, menu_width - item_x); data/swupdate-2020.04/scripts/kconfig/lxdialog/textbox.c:167:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). page = buf + strlen(buf); data/swupdate-2020.04/scripts/kconfig/lxdialog/textbox.c:346:14: [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 += MIN(strlen(line), hscroll); /* Scroll horizontally */ data/swupdate-2020.04/scripts/kconfig/lxdialog/textbox.c:349: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). waddnstr(win, line, MIN(strlen(line), width - 2)); data/swupdate-2020.04/scripts/kconfig/lxdialog/textbox.c:405: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). percent = (page - buf) * 100 / strlen(buf); data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:273:11: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len += strlen(pos->text) + 3; data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:280:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). skip = len - (columns - 2 - strlen(ellipsis)); data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:294: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 (skip < strlen(pos->text)) { data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:298: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). skip -= strlen(pos->text); data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:368: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). int tlen = MIN(width - 2, strlen(title)); data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:390: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). prompt_len = strlen(tempstr); data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:412: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). wlen = strlen(word); data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:415: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). && wlen + 1 + strlen(sp) > room data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:536: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). for (i = 0; i < strlen(string); i++) { data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:628:39: [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). avail = sizeof(item_cur->node.str) - strlen(item_cur->node.str); data/swupdate-2020.04/scripts/kconfig/lxdialog/util.c:631: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). vsnprintf(item_cur->node.str + strlen(item_cur->node.str), data/swupdate-2020.04/scripts/kconfig/mconf.c:424:48: [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 (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0) data/swupdate-2020.04/scripts/kconfig/mconf.c:425: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). dialog_input += strlen(CONFIG_); data/swupdate-2020.04/scripts/kconfig/mconf.c:616: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). tmp = 2 + strlen(sym_get_string_value(sym)); /* () = 2 */ data/swupdate-2020.04/scripts/kconfig/menu.c:590: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). jump->offset = strlen(r->s); data/swupdate-2020.04/scripts/kconfig/nconf.c:376: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). offset += strlen(function_keys[i].key_str); data/swupdate-2020.04/scripts/kconfig/nconf.c:380: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). offset += strlen(function_keys[i].func) + skip; data/swupdate-2020.04/scripts/kconfig/nconf.c:578:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(k_menu_items[index].str, data/swupdate-2020.04/scripts/kconfig/nconf.c:720:48: [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 (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0) data/swupdate-2020.04/scripts/kconfig/nconf.c:721: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). dialog_input += strlen(CONFIG_); data/swupdate-2020.04/scripts/kconfig/nconf.c:888: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). tmp = 2 + strlen(sym_get_string_value(sym)); data/swupdate-2020.04/scripts/kconfig/nconf.c:1036: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). state->pattern[strlen(state->pattern)] = c; data/swupdate-2020.04/scripts/kconfig/nconf.c:1037: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). state->pattern[strlen(state->pattern)] = '\0'; data/swupdate-2020.04/scripts/kconfig/nconf.c:1050: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). state->pattern[strlen(state->pattern)-1] = '\0'; data/swupdate-2020.04/scripts/kconfig/nconf.gui.c:167: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). length = strlen(string); data/swupdate-2020.04/scripts/kconfig/nconf.gui.c:227:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(tmp, line, min(len, x)); data/swupdate-2020.04/scripts/kconfig/nconf.gui.c:263:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). btns_width += strlen(btn)+1; data/swupdate-2020.04/scripts/kconfig/nconf.gui.c:369: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). int cursor_position = strlen(init); data/swupdate-2020.04/scripts/kconfig/nconf.gui.c:373: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(init)+1 > *result_len) { data/swupdate-2020.04/scripts/kconfig/nconf.gui.c:374:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). *result_len = strlen(init)+1; data/swupdate-2020.04/scripts/kconfig/nconf.gui.c:387: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). prompt_width = max(prompt_width, strlen(title)); data/swupdate-2020.04/scripts/kconfig/nconf.gui.c:393:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(result, init, *result_len); data/swupdate-2020.04/scripts/kconfig/nconf.gui.c:427:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(result); data/swupdate-2020.04/scripts/kconfig/symbol.c:668: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/swupdate-2020.04/scripts/kconfig/symbol.c:877: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/swupdate-2020.04/scripts/kconfig/symbol.c:887: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/swupdate-2020.04/scripts/kconfig/symbol.c:901: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/swupdate-2020.04/scripts/kconfig/symbol.c:901: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/swupdate-2020.04/scripts/kconfig/symbol.c:901: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/swupdate-2020.04/scripts/kconfig/symbol.c:922: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/swupdate-2020.04/scripts/kconfig/symbol.c:922: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/swupdate-2020.04/scripts/kconfig/symbol.c:939: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/swupdate-2020.04/scripts/kconfig/symbol.c:944: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/swupdate-2020.04/scripts/kconfig/symbol.c:950: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/swupdate-2020.04/scripts/kconfig/symbol.c:951: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/swupdate-2020.04/scripts/kconfig/symbol.c:954: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/swupdate-2020.04/scripts/kconfig/symbol.c:982:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). exact1 = (s1->eo - s1->so) == strlen(s1->sym->name); data/swupdate-2020.04/scripts/kconfig/symbol.c:983:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). exact2 = (s2->eo - s2->so) == strlen(s2->sym->name); data/swupdate-2020.04/scripts/kconfig/symbol.c:1003: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/swupdate-2020.04/scripts/kconfig/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/swupdate-2020.04/scripts/kconfig/util.c:105: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/swupdate-2020.04/scripts/kconfig/util.c:105: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/swupdate-2020.04/suricatta/common.c:27:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) data/swupdate-2020.04/suricatta/common.c:31:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) data/swupdate-2020.04/suricatta/common.c:34:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) data/swupdate-2020.04/suricatta/common.c:37:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) data/swupdate-2020.04/suricatta/common.c:40:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) data/swupdate-2020.04/suricatta/common.c:43:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) data/swupdate-2020.04/suricatta/common.c:46:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) data/swupdate-2020.04/suricatta/server_general.c:210:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(log) && strlen(log) < MAX_LOG_SIZE) data/swupdate-2020.04/suricatta/server_general.c:210:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(log) && strlen(log) < MAX_LOG_SIZE) data/swupdate-2020.04/suricatta/server_general.c:211: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(log,","); data/swupdate-2020.04/suricatta/server_general.c:214:4: [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(log, token, MAX_LOG_SIZE - strlen(log) - 1); data/swupdate-2020.04/suricatta/server_general.c:214:39: [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). strncat(log, token, MAX_LOG_SIZE - strlen(log) - 1); data/swupdate-2020.04/suricatta/server_general.c:216:4: [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(log, field, MAX_LOG_SIZE - strlen(log) - 1); data/swupdate-2020.04/suricatta/server_general.c:216:39: [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). strncat(log, field, MAX_LOG_SIZE - strlen(log) - 1); data/swupdate-2020.04/suricatta/server_general.c:252:21: [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 (!prog->url || !strlen(prog->url)) { data/swupdate-2020.04/suricatta/server_general.c:578:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) { data/swupdate-2020.04/suricatta/server_general.c:584:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) { data/swupdate-2020.04/suricatta/server_hawkbit.c:158: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 (tokens_header != NULL && strlen(tokens_header)) data/swupdate-2020.04/suricatta/server_hawkbit.c:223:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(deployment_update_action.forced)) == 0) { data/swupdate-2020.04/suricatta/server_hawkbit.c:228:14: [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(deployment_update_action.attempt)) == 0) { data/swupdate-2020.04/suricatta/server_hawkbit.c:233:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(deployment_update_action.skip)) == 0) { data/swupdate-2020.04/suricatta/server_hawkbit.c:933:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). data_avail = ret > 0 && (strlen(msg.data.status.desc) != 0); data/swupdate-2020.04/suricatta/server_hawkbit.c:954: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). for (int c = 0; c < strlen(msg.data.status.desc); c++) { data/swupdate-2020.04/suricatta/server_hawkbit.c:1102:21: [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 endfilename = strlen(s) - strlen(".swu"); data/swupdate-2020.04/suricatta/server_hawkbit.c:1102: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). int endfilename = strlen(s) - strlen(".swu"); data/swupdate-2020.04/suricatta/server_hawkbit.c:1450: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). len += strlen(key) + strlen(value) + strlen (" : ") + 6; data/swupdate-2020.04/suricatta/server_hawkbit.c:1450: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). len += strlen(key) + strlen(value) + strlen (" : ") + 6; data/swupdate-2020.04/suricatta/server_hawkbit.c:1450:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len += strlen(key) + strlen(value) + strlen (" : ") + 6; data/swupdate-2020.04/suricatta/server_hawkbit.c:1598:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) { data/swupdate-2020.04/suricatta/server_hawkbit.c:1603:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) { data/swupdate-2020.04/suricatta/server_hawkbit.c:1608:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) { data/swupdate-2020.04/suricatta/server_hawkbit.c:1622:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) data/swupdate-2020.04/suricatta/server_hawkbit.c:1625:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(tmp)) data/swupdate-2020.04/suricatta/suricatta.c:74:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, &msg, sizeof(msg)); data/swupdate-2020.04/test/test_crypt.c:37: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). for (unsigned int i = 0; i < strlen((const char *)source); i += 2) { data/swupdate-2020.04/test/test_crypt.c:49: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). unsigned char *buffer = calloc(1, strlen((const char *)CRYPTTEXT) + EVP_MAX_BLOCK_LENGTH); data/swupdate-2020.04/test/test_crypt.c:50:76: [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 ret = swupdate_DECRYPT_update(dcrypt, buffer, &len, crypt->crypttext, strlen((const char *)CRYPTTEXT) / 2); data/swupdate-2020.04/test/test_crypt.c:56: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). assert_true(len == (int)strlen((const char *)PLAINTEXT)); data/swupdate-2020.04/test/test_crypt.c:71: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). hex2bin((crypt.key = calloc(1, strlen((const char *)KEY))), KEY); data/swupdate-2020.04/test/test_crypt.c:72:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). hex2bin((crypt.iv = calloc(1, strlen((const char *)IV))), IV); data/swupdate-2020.04/test/test_crypt.c:73:39: [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). hex2bin((crypt.crypttext = calloc(1, strlen((const char *)CRYPTTEXT))), CRYPTTEXT); data/swupdate-2020.04/test/test_crypt.c:92: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). hex2bin((crypt.key = calloc(1, strlen((const char *)KEY))), KEY); data/swupdate-2020.04/test/test_crypt.c:93:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). hex2bin((crypt.iv = calloc(1, strlen((const char *)IV))), IV); data/swupdate-2020.04/test/test_crypt.c:94:39: [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). hex2bin((crypt.crypttext = calloc(1, strlen((const char *)CRYPTTEXT))), CRYPTTEXT); data/swupdate-2020.04/test/test_crypt.c:112: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). hex2bin((crypt.key = calloc(1, strlen((const char *)KEY))), KEY); data/swupdate-2020.04/test/test_crypt.c:113:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). hex2bin((crypt.iv = calloc(1, strlen((const char *)IV))), IV); data/swupdate-2020.04/test/test_crypt.c:114:39: [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). hex2bin((crypt.crypttext = calloc(1, strlen((const char *)CRYPTTEXT))), CRYPTTEXT); data/swupdate-2020.04/test/test_crypt.c:120: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). unsigned char *buffer = calloc(1, strlen((const char *)CRYPTTEXT) + EVP_MAX_BLOCK_LENGTH); data/swupdate-2020.04/test/test_crypt.c:121:75: [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 ret = swupdate_DECRYPT_update(dcrypt, buffer, &len, crypt.crypttext, strlen((const char *)CRYPTTEXT) / 2); data/swupdate-2020.04/test/test_hash.c:59: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). for (unsigned int i = 0; i < strlen((const char *)source); i += 2) { data/swupdate-2020.04/test/test_hash.c:75:55: [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). error = swupdate_HASH_update(dgst, (uint8_t *)input, strlen(input)); data/swupdate-2020.04/test/test_hash.c:80: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). assert_int_equal(len, strlen(expected_hex) / 2); data/swupdate-2020.04/test/test_server_hawkbit.c:96:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(channel_data->sha1hash, mock_type(char *), data/swupdate-2020.04/tools/swupdate-client.c:67:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, buf, sizeof(buf)); data/swupdate-2020.04/tools/swupdate-client.c:85:4: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). strlen(msg->data.status.desc) > 0 ? msg->data.status.desc : ""); data/swupdate-2020.04/tools/swupdate-progress.c:122: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). ret = write(psplash_pipe_fd, buf, strlen(buf) + 1); data/swupdate-2020.04/tools/swupdate-progress.c:165:2: [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/swupdate-2020.04/tools/swupdate-sysrestart.c:100: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(ipaddrs[dev])) data/swupdate-2020.04/tools/swupdate-sysrestart.c:231: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 (ipaddr && (strlen(ipaddr) > strlen(PATTERN))) { data/swupdate-2020.04/tools/swupdate-sysrestart.c:231: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). if (ipaddr && (strlen(ipaddr) > strlen(PATTERN))) { data/swupdate-2020.04/tools/swupdate-sysrestart.c:232: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). ipaddr += strlen(PATTERN); data/swupdate-2020.04/tools/swupdate-sysrestart.c:238:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ipaddrs[ndevs], ipaddr, sizeof(ipaddrs[ndevs])); ANALYSIS SUMMARY: Hits = 1119 Lines analyzed = 67370 in approximately 1.65 seconds (40932 lines/second) Physical Source Lines of Code (SLOC) = 50327 Hits@level = [0] 458 [1] 462 [2] 502 [3] 43 [4] 110 [5] 2 Hits@level+ = [0+] 1577 [1+] 1119 [2+] 657 [3+] 155 [4+] 112 [5+] 2 Hits/KSLOC@level+ = [0+] 31.3351 [1+] 22.2346 [2+] 13.0546 [3+] 3.07986 [4+] 2.22545 [5+] 0.0397401 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.