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/usbguard-0.7.8+ds/src/CLI/IPCSignalWatcher.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/IPCSignalWatcher.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/PolicyGenerator.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/PolicyGenerator.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-add-user.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-add-user.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-allow-device.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-allow-device.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-append-rule.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-append-rule.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-block-device.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-block-device.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-generate-policy.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-generate-policy.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-get-parameter.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-get-parameter.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-list-devices.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-list-devices.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-list-rules.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-list-rules.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-read-descriptor.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-read-descriptor.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-reject-device.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-reject-device.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-remove-rule.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-remove-rule.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-remove-user.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-remove-user.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-rule-parser.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-set-parameter.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-set-parameter.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-watch.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard-watch.hpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard.cpp
Examining data/usbguard-0.7.8+ds/src/CLI/usbguard.hpp
Examining data/usbguard-0.7.8+ds/src/Common/ByteOrder.hpp
Examining data/usbguard-0.7.8+ds/src/Common/FDInputStream.hpp
Examining data/usbguard-0.7.8+ds/src/Common/LDAPUtil.cpp
Examining data/usbguard-0.7.8+ds/src/Common/LDAPUtil.hpp
Examining data/usbguard-0.7.8+ds/src/Common/Thread.hpp
Examining data/usbguard-0.7.8+ds/src/Common/Utility.cpp
Examining data/usbguard-0.7.8+ds/src/Common/Utility.hpp
Examining data/usbguard-0.7.8+ds/src/DBus/DBusBridge.cpp
Examining data/usbguard-0.7.8+ds/src/DBus/DBusBridge.hpp
Examining data/usbguard-0.7.8+ds/src/DBus/gdbus-server.cpp
Examining data/usbguard-0.7.8+ds/src/Daemon/Daemon.cpp
Examining data/usbguard-0.7.8+ds/src/Daemon/Daemon.hpp
Examining data/usbguard-0.7.8+ds/src/Daemon/FileAuditBackend.cpp
Examining data/usbguard-0.7.8+ds/src/Daemon/FileAuditBackend.hpp
Examining data/usbguard-0.7.8+ds/src/Daemon/FileRuleSet.cpp
Examining data/usbguard-0.7.8+ds/src/Daemon/FileRuleSet.hpp
Examining data/usbguard-0.7.8+ds/src/Daemon/LDAPHandler.cpp
Examining data/usbguard-0.7.8+ds/src/Daemon/LDAPHandler.hpp
Examining data/usbguard-0.7.8+ds/src/Daemon/LDAPRuleSet.cpp
Examining data/usbguard-0.7.8+ds/src/Daemon/LDAPRuleSet.hpp
Examining data/usbguard-0.7.8+ds/src/Daemon/LinuxAuditBackend.cpp
Examining data/usbguard-0.7.8+ds/src/Daemon/LinuxAuditBackend.hpp
Examining data/usbguard-0.7.8+ds/src/Daemon/NSHandler.cpp
Examining data/usbguard-0.7.8+ds/src/Daemon/NSHandler.hpp
Examining data/usbguard-0.7.8+ds/src/Daemon/RuleSetFactory.cpp
Examining data/usbguard-0.7.8+ds/src/Daemon/RuleSetFactory.hpp
Examining data/usbguard-0.7.8+ds/src/Daemon/Seccomp.c
Examining data/usbguard-0.7.8+ds/src/Daemon/Seccomp.h
Examining data/usbguard-0.7.8+ds/src/Daemon/main.cpp
Examining data/usbguard-0.7.8+ds/src/Library/AllowedMatchesCondition.cpp
Examining data/usbguard-0.7.8+ds/src/Library/AllowedMatchesCondition.hpp
Examining data/usbguard-0.7.8+ds/src/Library/Base64.cpp
Examining data/usbguard-0.7.8+ds/src/Library/Base64.hpp
Examining data/usbguard-0.7.8+ds/src/Library/ConfigFilePrivate.cpp
Examining data/usbguard-0.7.8+ds/src/Library/ConfigFilePrivate.hpp
Examining data/usbguard-0.7.8+ds/src/Library/DeviceManagerPrivate.cpp
Examining data/usbguard-0.7.8+ds/src/Library/DeviceManagerPrivate.hpp
Examining data/usbguard-0.7.8+ds/src/Library/DevicePrivate.cpp
Examining data/usbguard-0.7.8+ds/src/Library/DevicePrivate.hpp
Examining data/usbguard-0.7.8+ds/src/Library/FixedStateCondition.cpp
Examining data/usbguard-0.7.8+ds/src/Library/FixedStateCondition.hpp
Examining data/usbguard-0.7.8+ds/src/Library/Hash.cpp
Examining data/usbguard-0.7.8+ds/src/Library/Hash.hpp
Examining data/usbguard-0.7.8+ds/src/Library/IPCClientPrivate.cpp
Examining data/usbguard-0.7.8+ds/src/Library/IPCClientPrivate.hpp
Examining data/usbguard-0.7.8+ds/src/Library/IPCPrivate.cpp
Examining data/usbguard-0.7.8+ds/src/Library/IPCPrivate.hpp
Examining data/usbguard-0.7.8+ds/src/Library/IPCServerPrivate.cpp
Examining data/usbguard-0.7.8+ds/src/Library/IPCServerPrivate.hpp
Examining data/usbguard-0.7.8+ds/src/Library/Init.cpp
Examining data/usbguard-0.7.8+ds/src/Library/KeyValueParserPrivate.cpp
Examining data/usbguard-0.7.8+ds/src/Library/KeyValueParserPrivate.hpp
Examining data/usbguard-0.7.8+ds/src/Library/LocaltimeCondition.cpp
Examining data/usbguard-0.7.8+ds/src/Library/LocaltimeCondition.hpp
Examining data/usbguard-0.7.8+ds/src/Library/RandomStateCondition.cpp
Examining data/usbguard-0.7.8+ds/src/Library/RandomStateCondition.hpp
Examining data/usbguard-0.7.8+ds/src/Library/RuleAppliedCondition.cpp
Examining data/usbguard-0.7.8+ds/src/Library/RuleAppliedCondition.hpp
Examining data/usbguard-0.7.8+ds/src/Library/RuleEvaluatedCondition.cpp
Examining data/usbguard-0.7.8+ds/src/Library/RuleEvaluatedCondition.hpp
Examining data/usbguard-0.7.8+ds/src/Library/RuleParser/Actions.hpp
Examining data/usbguard-0.7.8+ds/src/Library/RuleParser/Grammar.hpp
Examining data/usbguard-0.7.8+ds/src/Library/RulePrivate.cpp
Examining data/usbguard-0.7.8+ds/src/Library/RulePrivate.hpp
Examining data/usbguard-0.7.8+ds/src/Library/SysFSDevice.cpp
Examining data/usbguard-0.7.8+ds/src/Library/SysFSDevice.hpp
Examining data/usbguard-0.7.8+ds/src/Library/UEvent.cpp
Examining data/usbguard-0.7.8+ds/src/Library/UEvent.hpp
Examining data/usbguard-0.7.8+ds/src/Library/UEventDeviceManager.cpp
Examining data/usbguard-0.7.8+ds/src/Library/UEventDeviceManager.hpp
Examining data/usbguard-0.7.8+ds/src/Library/UEventParser.cpp
Examining data/usbguard-0.7.8+ds/src/Library/UEventParser.hpp
Examining data/usbguard-0.7.8+ds/src/Library/UMockdevDeviceDefinition.cpp
Examining data/usbguard-0.7.8+ds/src/Library/UMockdevDeviceDefinition.hpp
Examining data/usbguard-0.7.8+ds/src/Library/UMockdevDeviceManager.cpp
Examining data/usbguard-0.7.8+ds/src/Library/UMockdevDeviceManager.hpp
Examining data/usbguard-0.7.8+ds/src/Library/Utility.cpp
Examining data/usbguard-0.7.8+ds/src/Library/Utility.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Audit.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Audit.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/ConfigFile.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/ConfigFile.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Device.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Device.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/DeviceManager.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/DeviceManager.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/DeviceManagerHooks.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/DeviceManagerHooks.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Exception.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/IPCClient.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/IPCClient.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/IPCServer.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/IPCServer.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Interface.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/KeyValueParser.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/KeyValueParser.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Logger.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Logger.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/MemoryRuleSet.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/MemoryRuleSet.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Policy.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Policy.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Predicates.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Rule.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Rule.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/RuleCondition.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/RuleCondition.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/RuleParser.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/RuleParser.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/RuleSet.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/RuleSet.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Typedefs.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/Typedefs.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/USB.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/USB.hpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/USBGuard.cpp
Examining data/usbguard-0.7.8+ds/src/Library/public/usbguard/USBGuard.hpp
Examining data/usbguard-0.7.8+ds/src/Tests/Fuzzers/fuzzer-rules.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Fuzzers/fuzzer-uevent.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Fuzzers/fuzzer-usb-descriptor.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Regression/github-PR209-config-parser.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Regression/test_Rule_ghi113.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Regression/test_Rule_ghi247.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Regression/test_Rule_ghi37.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Unit/test_Base64.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Unit/test_IPCServer_AccessControl.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Unit/test_Rule.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Unit/test_RuleAttribute_id.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Unit/test_RuleParser.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Unit/test_UEvent.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Unit/test_UEventParser.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Unit/test_UMockdevDeviceDefinition.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/Unit/test_UMockdevDeviceDefinition.data.hpp
Examining data/usbguard-0.7.8+ds/src/Tests/Unit/test_Utility.cpp
Examining data/usbguard-0.7.8+ds/src/Tests/main.cpp

FINAL RESULTS:

data/usbguard-0.7.8+ds/src/Common/Utility.cpp:439:31:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    const ssize_t link_size = readlink(linkpath.c_str(), &buffer[0], buffer.capacity());
data/usbguard-0.7.8+ds/src/Daemon/Seccomp.c:59:57:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
  ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(chown), 0);
data/usbguard-0.7.8+ds/src/Daemon/Seccomp.c:60:57:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
  ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(chmod), 0);
data/usbguard-0.7.8+ds/src/Daemon/Seccomp.c:64:57:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
  ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(readlink), 0);
data/usbguard-0.7.8+ds/src/Common/Utility.cpp:103:13:  [4] (shell) execv:
  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.
    (void)::execv(path.c_str(), args_cstr);
data/usbguard-0.7.8+ds/src/Daemon/Seccomp.c:65:57:  [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.
  ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(access), 0);
data/usbguard-0.7.8+ds/src/Library/UMockdevDeviceManager.cpp:325:9:  [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((SysFSDevice::getSysfsRoot() + definition->getSysfsPath()).c_str(), F_OK) == 0) {
data/usbguard-0.7.8+ds/src/Library/UMockdevDeviceManager.cpp:1085:11:  [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(umockdev_devpath.c_str(), F_OK) != 0) {
data/usbguard-0.7.8+ds/src/Library/public/usbguard/Logger.cpp:431:24:  [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.
    const int length = snprintf(buffer, sizeof buffer, "%.10" PRIu64 ".%03" PRIu64,
data/usbguard-0.7.8+ds/src/CLI/usbguard-add-user.cpp:94: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-allow-device.cpp:59: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-append-rule.cpp:60: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-block-device.cpp:59: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-generate-policy.cpp:93: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-get-parameter.cpp:52: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-list-devices.cpp:58: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-list-rules.cpp:58: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-read-descriptor.cpp:109: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-reject-device.cpp:59: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-remove-rule.cpp:52: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-remove-user.cpp:75: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-rule-parser.cpp:63:17:  [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(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-set-parameter.cpp:55: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/CLI/usbguard-watch.cpp:62: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 ((opt = getopt_long(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/DBus/gdbus-server.cpp:227:17:  [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(argc, argv, options_short, options_long, nullptr)) != -1) {
data/usbguard-0.7.8+ds/src/Daemon/main.cpp:86:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while ((opt = getopt(argc, argv, G_optstring)) != -1) {
data/usbguard-0.7.8+ds/src/Library/UEventDeviceManager.cpp:790:13:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
      if (::realpath(devpath.c_str(), &sysfs_absolute_path[0]) == nullptr) {
data/usbguard-0.7.8+ds/src/Library/UMockdevDeviceManager.cpp:283:34:  [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* const envval = ::getenv("USBGUARD_UMOCKDEV_DEVICEDIR");
data/usbguard-0.7.8+ds/src/Library/UMockdevDeviceManager.cpp:1090:13:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
      if (::realpath(umockdev_devpath.c_str(), &umockdev_realpath[0]) == nullptr) {
data/usbguard-0.7.8+ds/src/Library/public/usbguard/Logger.cpp:281:32:  [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* const envval = getenv("USBGUARD_DEBUG");
data/usbguard-0.7.8+ds/src/Library/public/usbguard/USBGuard.cpp:41:33:  [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* const  envval = getenv("USBGUARD_DAEMON_CONF");
data/usbguard-0.7.8+ds/src/CLI/IPCSignalWatcher.cpp:151:22:  [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).
    const int fd = ::open(path.c_str(), O_RDONLY);
data/usbguard-0.7.8+ds/src/CLI/IPCSignalWatcher.cpp:305: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(c_str_copy, c_str, c_str_len);
data/usbguard-0.7.8+ds/src/CLI/usbguard-generate-policy.cpp:159: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 array[HOST_NAME_MAX];
data/usbguard-0.7.8+ds/src/Common/Utility.cpp:55:26:  [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).
    const int nullfd = ::open("/dev/null", O_RDWR);
data/usbguard-0.7.8+ds/src/Daemon/Daemon.cpp:194: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).
    _config.open(path, /*readonly=*/true);
data/usbguard-0.7.8+ds/src/Daemon/Daemon.cpp:622:51:  [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).
    USBGUARD_SYSCALL_THROW("Daemonize", (pid_fd = open(pid_file.c_str(), O_RDWR|O_CREAT, 0640)) < 0);
data/usbguard-0.7.8+ds/src/Daemon/Daemon.cpp:644:52:  [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).
    USBGUARD_SYSCALL_THROW("Daemonize", (fd_null = open("/dev/null", O_RDWR)) < 0);
data/usbguard-0.7.8+ds/src/Daemon/LDAPHandler.cpp:60: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 array[HOST_NAME_MAX];
data/usbguard-0.7.8+ds/src/Daemon/Seccomp.c:52:57:  [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).
  ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0);
data/usbguard-0.7.8+ds/src/Library/Base64.cpp:30: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.
  static const char encode_map[64+1] =
data/usbguard-0.7.8+ds/src/Library/Base64.cpp:35: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.
  static const char decode_map[80] = {
data/usbguard-0.7.8+ds/src/Library/Base64.cpp:119:47:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static void __b64_enc3(const uint8_t in[3], char out[4])
data/usbguard-0.7.8+ds/src/Library/Base64.cpp:127:48:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (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 __b64_enc2 (const uint8_t in[2], char out[4])
data/usbguard-0.7.8+ds/src/Library/Base64.cpp:135:45:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (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 __b64_enc1 (const uint8_t in, char out[4])
data/usbguard-0.7.8+ds/src/Library/Base64.cpp:178:33:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static void __b64_dec4 (const char in[4], uint8_t out[3])
data/usbguard-0.7.8+ds/src/Library/Base64.cpp:186:33:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static void __b64_dec3 (const char in[3], uint8_t out[2])
data/usbguard-0.7.8+ds/src/Library/Base64.cpp:193:33:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  static void __b64_dec2 (const char in[2], uint8_t out[1])
data/usbguard-0.7.8+ds/src/Library/ConfigFilePrivate.cpp:54: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).
  void ConfigFilePrivate::open(const std::string& path, bool readonly)
data/usbguard-0.7.8+ds/src/Library/ConfigFilePrivate.cpp:59: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).
      _stream.open(path, std::ios::in);
data/usbguard-0.7.8+ds/src/Library/ConfigFilePrivate.cpp:62: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).
      _stream.open(path, std::ios::in|std::ios::out);
data/usbguard-0.7.8+ds/src/Library/ConfigFilePrivate.hpp:42: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).
    void open(const std::string& path, bool readonly);
data/usbguard-0.7.8+ds/src/Library/SysFSDevice.cpp:75: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).
      (_sysfs_dirfd = open((G_sysfs_root + _sysfs_path).c_str(), O_PATH|O_DIRECTORY)) < 0);
data/usbguard-0.7.8+ds/src/Library/UMockdevDeviceManager.cpp:510:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buffer[sizeof (inotify_event) + NAME_MAX + 1] __attribute__((aligned(__alignof__(inotify_event))));
data/usbguard-0.7.8+ds/src/Library/UMockdevDeviceManager.cpp:828: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.
          char prefix[8];
data/usbguard-0.7.8+ds/src/Library/public/usbguard/ConfigFile.cpp:35:20:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  void ConfigFile::open(const std::string& path, bool readonly)
data/usbguard-0.7.8+ds/src/Library/public/usbguard/ConfigFile.cpp:37: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).
    d_pointer->open(path, readonly);
data/usbguard-0.7.8+ds/src/Library/public/usbguard/ConfigFile.hpp:67: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).
    void open(const std::string& path, bool readonly = false);
data/usbguard-0.7.8+ds/src/Library/public/usbguard/Exception.hpp:128: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 buffer[1024];
data/usbguard-0.7.8+ds/src/Library/public/usbguard/Logger.cpp:221: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).
        _stream.open(filepath, append ? std::fstream::app : std::fstream::trunc);
data/usbguard-0.7.8+ds/src/Library/public/usbguard/Logger.cpp:248: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).
        _stream.open(filepath, std::fstream::app);
data/usbguard-0.7.8+ds/src/Library/public/usbguard/Logger.cpp:430:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buffer[16];
data/usbguard-0.7.8+ds/src/Library/public/usbguard/USBGuard.cpp:58: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).
    daemon_conf.open(daemon_conf_path);
data/usbguard-0.7.8+ds/src/Tests/Regression/github-PR209-config-parser.cpp:33:20:  [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).
  const int fd = ::mkstemp(&filepath[0]);
data/usbguard-0.7.8+ds/src/Tests/Regression/github-PR209-config-parser.cpp:59:28:  [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).
    REQUIRE_NOTHROW(config.open(path));
data/usbguard-0.7.8+ds/src/Tests/Regression/github-PR209-config-parser.cpp:63:28:  [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).
    REQUIRE_NOTHROW(config.open(path));
data/usbguard-0.7.8+ds/src/Tests/Regression/github-PR209-config-parser.cpp:67: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).
    REQUIRE_THROWS(config.open(path));
data/usbguard-0.7.8+ds/src/Tests/Regression/github-PR209-config-parser.cpp:71:28:  [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).
    REQUIRE_NOTHROW(config.open(path));
data/usbguard-0.7.8+ds/src/Tests/Regression/github-PR209-config-parser.cpp:75: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).
    REQUIRE_THROWS(config.open(path));
data/usbguard-0.7.8+ds/src/Tests/Regression/github-PR209-config-parser.cpp:79:28:  [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).
    REQUIRE_NOTHROW(config.open(path));
data/usbguard-0.7.8+ds/src/CLI/IPCSignalWatcher.cpp:299: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).
    const auto c_str_len = ::strlen(c_str);
data/usbguard-0.7.8+ds/src/CLI/usbguard-add-user.cpp:76:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(0177);
data/usbguard-0.7.8+ds/src/Common/FDInputStream.hpp:65:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ret = read(fd_, s, n);
data/usbguard-0.7.8+ds/src/Common/Utility.cpp:149:11:  [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(500);
data/usbguard-0.7.8+ds/src/Common/Utility.cpp:172:9:  [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(1000*500);
data/usbguard-0.7.8+ds/src/Daemon/Daemon.cpp:640:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(0047);  /* no need for world-accessible or executable files */
data/usbguard-0.7.8+ds/src/Daemon/LinuxAuditBackend.cpp:103: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).
    vlen = ::strlen(value);
data/usbguard-0.7.8+ds/src/Daemon/Seccomp.c:51:57:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ret |= seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(read), 0);
data/usbguard-0.7.8+ds/src/Library/Hash.cpp:126:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      stream.read(reinterpret_cast<char*>(buffer), sizeof buffer);
data/usbguard-0.7.8+ds/src/Library/IPCClientPrivate.cpp:45:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(fd, &one, sizeof one) != sizeof one) {
data/usbguard-0.7.8+ds/src/Library/IPCServerPrivate.cpp:176:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(fd, &one, sizeof one) != sizeof one) {
data/usbguard-0.7.8+ds/src/Library/SysFSDevice.cpp:178:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      (rc = read(fd, &buffer[0], buffer.capacity())) < 0);
data/usbguard-0.7.8+ds/src/Library/UEventDeviceManager.cpp:542:9:  [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(1000);
data/usbguard-0.7.8+ds/src/Library/UEventDeviceManager.cpp:795: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).
      sysfs_absolute_path.resize(::strlen(&sysfs_absolute_path[0]));
data/usbguard-0.7.8+ds/src/Library/UMockdevDeviceManager.cpp:512:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read (_inotify_fd, buffer, sizeof buffer) <= 0) {
data/usbguard-0.7.8+ds/src/Library/UMockdevDeviceManager.cpp:824: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 (buffer.substr(0, strlen("libudev")) == "libudev") {
data/usbguard-0.7.8+ds/src/Library/UMockdevDeviceManager.cpp:1095: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).
      umockdev_realpath.resize(::strlen(&umockdev_realpath[0]));
data/usbguard-0.7.8+ds/src/Library/public/usbguard/Logger.cpp:244:32:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
      const auto saved_umask = umask(0177);
data/usbguard-0.7.8+ds/src/Library/public/usbguard/Logger.cpp:251:9:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
        umask(saved_umask);
data/usbguard-0.7.8+ds/src/Library/public/usbguard/Logger.cpp:255:7:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
      umask(saved_umask);
data/usbguard-0.7.8+ds/src/Library/public/usbguard/USB.cpp:431:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      stream.read(reinterpret_cast<char*>(&header), sizeof header);
data/usbguard-0.7.8+ds/src/Library/public/usbguard/USB.cpp:471:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      stream.read(reinterpret_cast<char*>(&descriptor.bDescriptorData), header.bLength - sizeof(USBDescriptorHeader));

ANALYSIS SUMMARY:

Hits = 92
Lines analyzed = 29271 in approximately 0.68 seconds (42860 lines/second)
Physical Source Lines of Code (SLOC) = 18069
Hits@level = [0]  16 [1]  22 [2]  39 [3]  22 [4]   5 [5]   4
Hits@level+ = [0+] 108 [1+]  92 [2+]  70 [3+]  31 [4+]   9 [5+]   4
Hits/KSLOC@level+ = [0+] 5.97709 [1+] 5.09159 [2+] 3.87404 [3+] 1.71565 [4+] 0.498091 [5+] 0.221374
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.