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/cockpit-231/src/ws/session-utils.h Examining data/cockpit-231/src/ws/cockpitauth.c Examining data/cockpit-231/src/ws/test-creds.c Examining data/cockpit-231/src/ws/remotectl-certificate.c Examining data/cockpit-231/src/ws/cockpitcreds.c Examining data/cockpit-231/src/ws/cockpitcompat.h Examining data/cockpit-231/src/ws/cockpitws.h Examining data/cockpit-231/src/ws/test-kerberos.c Examining data/cockpit-231/src/ws/cockpitwsinstancecert.h Examining data/cockpit-231/src/ws/test-auth.c Examining data/cockpit-231/src/ws/cockpitchannelresponse.h Examining data/cockpit-231/src/ws/cockpitauth.h Examining data/cockpit-231/src/ws/test-server.c Examining data/cockpit-231/src/ws/test-handlers.c Examining data/cockpit-231/src/ws/mock-pam-conv-mod.c Examining data/cockpit-231/src/ws/remotectl.c Examining data/cockpit-231/src/ws/mock-echo.c Examining data/cockpit-231/src/ws/session.c Examining data/cockpit-231/src/ws/cockpitcompat.c Examining data/cockpit-231/src/ws/remotectl.h Examining data/cockpit-231/src/ws/session-utils.c Examining data/cockpit-231/src/ws/test-webservice.c Examining data/cockpit-231/src/ws/test-channelresponse.c Examining data/cockpit-231/src/ws/test-compat.c Examining data/cockpit-231/src/ws/mock-auth.c Examining data/cockpit-231/src/ws/cockpithandlers.c Examining data/cockpit-231/src/ws/cockpithandlers.h Examining data/cockpit-231/src/ws/main.c Examining data/cockpit-231/src/ws/cockpitchannelresponse.c Examining data/cockpit-231/src/ws/cockpitbranding.h Examining data/cockpit-231/src/ws/cockpitwsinstancecert.c Examining data/cockpit-231/src/ws/cockpitbranding.c Examining data/cockpit-231/src/ws/cockpitcreds.h Examining data/cockpit-231/src/ws/cockpitwebservice.c Examining data/cockpit-231/src/ws/test-authssh.c Examining data/cockpit-231/src/ws/mock-service.h Examining data/cockpit-231/src/ws/mock-auth-command.c Examining data/cockpit-231/src/ws/test-remotectlcertificate.c Examining data/cockpit-231/src/ws/cockpitchannelsocket.h Examining data/cockpit-231/src/ws/mock-auth.h Examining data/cockpit-231/src/ws/mock-service.c Examining data/cockpit-231/src/ws/cockpitcertificate.h Examining data/cockpit-231/src/ws/cockpitcertificate.c Examining data/cockpit-231/src/ws/cockpitwebservice.h Examining data/cockpit-231/src/ws/pam_cockpit_cert.c Examining data/cockpit-231/src/ws/cockpitchannelsocket.c Examining data/cockpit-231/src/pam-ssh-add/test-ssh-add.c Examining data/cockpit-231/src/pam-ssh-add/pam-ssh-add.h Examining data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c Examining data/cockpit-231/src/ssh/mock-sshd.c Examining data/cockpit-231/src/ssh/cockpitsshrelay.h Examining data/cockpit-231/src/ssh/ssh.c Examining data/cockpit-231/src/ssh/test-sshbridge.c Examining data/cockpit-231/src/ssh/test-sshoptions.c Examining data/cockpit-231/src/ssh/cockpitsshoptions.c Examining data/cockpit-231/src/ssh/cockpitsshoptions.h Examining data/cockpit-231/src/ssh/cockpitsshrelay.c Examining data/cockpit-231/src/tls/socket-io.c Examining data/cockpit-231/src/tls/connection.h Examining data/cockpit-231/src/tls/test-server.c Examining data/cockpit-231/src/tls/server.c Examining data/cockpit-231/src/tls/socket-activation-helper.c Examining data/cockpit-231/src/tls/utils.h Examining data/cockpit-231/src/tls/testing.h Examining data/cockpit-231/src/tls/test-connection.c Examining data/cockpit-231/src/tls/server.h Examining data/cockpit-231/src/tls/main.c Examining data/cockpit-231/src/tls/connection.c Examining data/cockpit-231/src/tls/wsinstance-factory.c Examining data/cockpit-231/src/tls/certfile.h Examining data/cockpit-231/src/tls/socket-io.h Examining data/cockpit-231/src/tls/test-certfile.c Examining data/cockpit-231/src/tls/certfile.c Examining data/cockpit-231/src/tls/wsinstance-start.c Examining data/cockpit-231/src/bridge/cockpitpaths.h Examining data/cockpit-231/src/bridge/cockpitpackages.c Examining data/cockpit-231/src/bridge/cockpitechochannel.c Examining data/cockpit-231/src/bridge/cockpitpcpmetrics.c Examining data/cockpit-231/src/bridge/cockpitwebsocketstream.h Examining data/cockpit-231/src/bridge/test-pcp-archives.c Examining data/cockpit-231/src/bridge/cockpitcgroupsamples.h Examining data/cockpit-231/src/bridge/cockpitfsreplace.c Examining data/cockpit-231/src/bridge/cockpitfsread.h Examining data/cockpit-231/src/bridge/cockpitdisksamples.c Examining data/cockpit-231/src/bridge/test-httpstream.c Examining data/cockpit-231/src/bridge/cockpitpcp.c Examining data/cockpit-231/src/bridge/cockpitnetworksamples.c Examining data/cockpit-231/src/bridge/cockpitpackages.h Examining data/cockpit-231/src/bridge/cockpitsamples.c Examining data/cockpit-231/src/bridge/test-metrics.c Examining data/cockpit-231/src/bridge/cockpitstream.c Examining data/cockpit-231/src/bridge/cockpitmemorysamples.c Examining data/cockpit-231/src/bridge/test-packages.c Examining data/cockpit-231/src/bridge/cockpitechochannel.h Examining data/cockpit-231/src/bridge/cockpitinternalmetrics.h Examining data/cockpit-231/src/bridge/test-bridge.c Examining data/cockpit-231/src/bridge/cockpitinternalmetrics.c Examining data/cockpit-231/src/bridge/cockpitdbuscache.h Examining data/cockpit-231/src/bridge/cockpitpolkitagent.h Examining data/cockpit-231/src/bridge/cockpitpacketchannel.h Examining data/cockpit-231/src/bridge/cockpitdbusloginmessages.c Examining data/cockpit-231/src/bridge/cockpithttpstream.h Examining data/cockpit-231/src/bridge/cockpitpcpmetrics.h Examining data/cockpit-231/src/bridge/cockpitmetrics.c Examining data/cockpit-231/src/bridge/test-process.c Examining data/cockpit-231/src/bridge/cockpitmemorysamples.h Examining data/cockpit-231/src/bridge/cockpitpeer.h Examining data/cockpit-231/src/bridge/cockpitdbusmeta.h Examining data/cockpit-231/src/bridge/cockpitdbusrules.h Examining data/cockpit-231/src/bridge/cockpitdbusconfig.c Examining data/cockpit-231/src/bridge/cockpitwebsocketstream.c Examining data/cockpit-231/src/bridge/test-router.c Examining data/cockpit-231/src/bridge/cockpitdbusprocess.c Examining data/cockpit-231/src/bridge/cockpitmetrics.h Examining data/cockpit-231/src/bridge/cockpitdisksamples.h Examining data/cockpit-231/src/bridge/test-dbus-meta.c Examining data/cockpit-231/src/bridge/cockpitrouter.c Examining data/cockpit-231/src/bridge/cockpitdbusmeta.c Examining data/cockpit-231/src/bridge/cockpitsamples.h Examining data/cockpit-231/src/bridge/cockpithttpstream.c Examining data/cockpit-231/src/bridge/test-websocketstream.c Examining data/cockpit-231/src/bridge/test-pcp.c Examining data/cockpit-231/src/bridge/cockpitdbusmachines.c Examining data/cockpit-231/src/bridge/cockpitdbusinternal.c Examining data/cockpit-231/src/bridge/cockpitdbusjson.c Examining data/cockpit-231/src/bridge/cockpitcgroupsamples.c Examining data/cockpit-231/src/bridge/cockpitdbusrules.c Examining data/cockpit-231/src/bridge/cockpitnullchannel.h Examining data/cockpit-231/src/bridge/test-stream.c Examining data/cockpit-231/src/bridge/cockpitpacketchannel.c Examining data/cockpit-231/src/bridge/cockpitfsread.c Examining data/cockpit-231/src/bridge/test-packet-channel.c Examining data/cockpit-231/src/bridge/cockpitblocksamples.c Examining data/cockpit-231/src/bridge/cockpitinteracttransport.h Examining data/cockpit-231/src/bridge/cockpitfswatch.h Examining data/cockpit-231/src/bridge/cockpitdbusjson.h Examining data/cockpit-231/src/bridge/cockpitpeer.c Examining data/cockpit-231/src/bridge/cockpitdbusinternal.h Examining data/cockpit-231/src/bridge/cockpitconnect.h Examining data/cockpit-231/src/bridge/cockpitpolkitagent.c Examining data/cockpit-231/src/bridge/cockpitrouter.h Examining data/cockpit-231/src/bridge/test-peer.c Examining data/cockpit-231/src/bridge/cockpitdbususer.c Examining data/cockpit-231/src/bridge/cockpitfsreplace.h Examining data/cockpit-231/src/bridge/cockpitpipechannel.h Examining data/cockpit-231/src/bridge/cockpitfswatch.c Examining data/cockpit-231/src/bridge/cockpitinteracttransport.c Examining data/cockpit-231/src/bridge/cockpitdbuscache.c Examining data/cockpit-231/src/bridge/cockpitcpusamples.c Examining data/cockpit-231/src/bridge/cockpitstream.h Examining data/cockpit-231/src/bridge/cockpitconnect.c Examining data/cockpit-231/src/bridge/cockpitnullchannel.c Examining data/cockpit-231/src/bridge/cockpitfslist.h Examining data/cockpit-231/src/bridge/cockpitcpusamples.h Examining data/cockpit-231/src/bridge/bridge.c Examining data/cockpit-231/src/bridge/cockpitmountsamples.c Examining data/cockpit-231/src/bridge/cockpitpaths.c Examining data/cockpit-231/src/bridge/test-pipe-channel.c Examining data/cockpit-231/src/bridge/test-rules.c Examining data/cockpit-231/src/bridge/cockpitpipechannel.c Examining data/cockpit-231/src/bridge/cockpitblocksamples.h Examining data/cockpit-231/src/bridge/test-connect.c Examining data/cockpit-231/src/bridge/mock-pmda.c Examining data/cockpit-231/src/bridge/cockpitfslist.c Examining data/cockpit-231/src/bridge/askpass.c Examining data/cockpit-231/src/bridge/cockpitmountsamples.h Examining data/cockpit-231/src/bridge/cockpitnetworksamples.h Examining data/cockpit-231/src/bridge/test-fs.c Examining data/cockpit-231/src/bridge/mock-bridge.c Examining data/cockpit-231/src/bridge/test-paths.c Examining data/cockpit-231/src/common/cockpitwebfilter.h Examining data/cockpit-231/src/common/test-unixsignal.c Examining data/cockpit-231/src/common/test-json.c Examining data/cockpit-231/src/common/cockpitbase64.c Examining data/cockpit-231/src/common/cockpitframe.h Examining data/cockpit-231/src/common/cockpitunicode.c Examining data/cockpit-231/src/common/cockpitlocale.h Examining data/cockpit-231/src/common/cockpitjsonprint.c Examining data/cockpit-231/src/common/cockpiterror.c Examining data/cockpit-231/src/common/mock-channel.h Examining data/cockpit-231/src/common/cockpitwebinject.c Examining data/cockpit-231/src/common/mock-pressure.c Examining data/cockpit-231/src/common/cockpitmachinesjson.h Examining data/cockpit-231/src/common/mock-channel.c Examining data/cockpit-231/src/common/test-unicode.c Examining data/cockpit-231/src/common/cockpithash.c Examining data/cockpit-231/src/common/cockpitmemory.c Examining data/cockpit-231/src/common/cockpitunixfd.h Examining data/cockpit-231/src/common/mock-io-stream.h Examining data/cockpit-231/src/common/test-system.c Examining data/cockpit-231/src/common/test-webserver.c Examining data/cockpit-231/src/common/cockpitwebserver.c Examining data/cockpit-231/src/common/cockpitunixfd.c Examining data/cockpit-231/src/common/cockpitwebserver.h Examining data/cockpit-231/src/common/cockpitunixsignal.h Examining data/cockpit-231/src/common/cockpitchannel.h Examining data/cockpit-231/src/common/cockpitwebinject.h Examining data/cockpit-231/src/common/test-transport.c Examining data/cockpit-231/src/common/preload-temp-home.c Examining data/cockpit-231/src/common/cockpitjson.c Examining data/cockpit-231/src/common/mock-pressure.h Examining data/cockpit-231/src/common/cockpitmemfdread.h Examining data/cockpit-231/src/common/test-locale.c Examining data/cockpit-231/src/common/cockpitcontrolmessages.c Examining data/cockpit-231/src/common/mock-transport.h Examining data/cockpit-231/src/common/test-channel.c Examining data/cockpit-231/src/common/cockpitwebresponse.h Examining data/cockpit-231/src/common/cockpitconf.h Examining data/cockpit-231/src/common/cockpitversion.c Examining data/cockpit-231/src/common/cockpitjson.h Examining data/cockpit-231/src/common/cockpitwebcertificate.h Examining data/cockpit-231/src/common/cockpitauthorize.c Examining data/cockpit-231/src/common/cockpitsystem.c Examining data/cockpit-231/src/common/cockpitflow.h Examining data/cockpit-231/src/common/cockpitpipe.c Examining data/cockpit-231/src/common/cockpitpipetransport.c Examining data/cockpit-231/src/common/cockpitassets.c Examining data/cockpit-231/src/common/cockpitframe.c Examining data/cockpit-231/src/common/cockpittransport.c Examining data/cockpit-231/src/common/cockpitassets.h Examining data/cockpit-231/src/common/cockpitpipetransport.h Examining data/cockpit-231/src/common/test-hash.c Examining data/cockpit-231/src/common/cockpitpipe.h Examining data/cockpit-231/src/common/test-hex.c Examining data/cockpit-231/src/common/cockpitauthorize.h Examining data/cockpit-231/src/common/cockpittest.c Examining data/cockpit-231/src/common/cockpitflow.c Examining data/cockpit-231/src/common/test-config.c Examining data/cockpit-231/src/common/cockpitmemory.h Examining data/cockpit-231/src/common/cockpittemplate.c Examining data/cockpit-231/src/common/test-version.c Examining data/cockpit-231/src/common/mock-io-stream.c Examining data/cockpit-231/src/common/test-webcertificate.c Examining data/cockpit-231/src/common/mock-transport.c Examining data/cockpit-231/src/common/test-template.c Examining data/cockpit-231/src/common/cockpitmachinesjson.c Examining data/cockpit-231/src/common/cockpitunixsignal.c Examining data/cockpit-231/src/common/cockpitwebfilter.c Examining data/cockpit-231/src/common/cockpitchannel.c Examining data/cockpit-231/src/common/cockpithex.c Examining data/cockpit-231/src/common/cockpittransport.h Examining data/cockpit-231/src/common/cockpitwebresponse.c Examining data/cockpit-231/src/common/cockpitwebcertificate.c Examining data/cockpit-231/src/common/cockpitbase64.h Examining data/cockpit-231/src/common/test-base64.c Examining data/cockpit-231/src/common/test-jsonfds.c Examining data/cockpit-231/src/common/cockpittemplate.h Examining data/cockpit-231/src/common/cockpitlocale.c Examining data/cockpit-231/src/common/cockpittest.h Examining data/cockpit-231/src/common/test-pipe.c Examining data/cockpit-231/src/common/cockpitunicode.h Examining data/cockpit-231/src/common/cockpithacks.h Examining data/cockpit-231/src/common/cockpitconf.c Examining data/cockpit-231/src/common/cockpiterror.h Examining data/cockpit-231/src/common/test-webresponse.c Examining data/cockpit-231/src/common/test-authorize.c Examining data/cockpit-231/src/common/cockpitloopback.c Examining data/cockpit-231/src/common/cockpithacks-glib.h Examining data/cockpit-231/src/common/cockpitjsonprint.h Examining data/cockpit-231/src/common/cockpitsystem.h Examining data/cockpit-231/src/common/cockpitcontrolmessages.h Examining data/cockpit-231/src/common/cockpithex.h Examining data/cockpit-231/src/common/cockpitversion.h Examining data/cockpit-231/src/common/cockpitmemfdread.c Examining data/cockpit-231/src/common/cockpitloopback.h Examining data/cockpit-231/src/common/cockpithash.h Examining data/cockpit-231/src/retest/retest.c Examining data/cockpit-231/src/retest/retest.h Examining data/cockpit-231/src/websocket/websocketclient.c Examining data/cockpit-231/src/websocket/frob-websocket.c Examining data/cockpit-231/src/websocket/websocketserver.h Examining data/cockpit-231/src/websocket/websocketserver.c Examining data/cockpit-231/src/websocket/websocketprivate.h Examining data/cockpit-231/src/websocket/test-websocket.c Examining data/cockpit-231/src/websocket/websocketconnection.c Examining data/cockpit-231/src/websocket/websocketclient.h Examining data/cockpit-231/src/websocket/websocketconnection.h Examining data/cockpit-231/src/websocket/websocket.c Examining data/cockpit-231/src/websocket/websocket.h FINAL RESULTS: data/cockpit-231/src/bridge/test-fs.c:331:13: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. g_assert (chmod (tc->test_path, 0) >= 0); data/cockpit-231/src/bridge/test-fs.c:612:13: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. g_assert (chmod (tc->test_dir, 0) >= 0); data/cockpit-231/src/bridge/test-fs.c:622:13: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. g_assert (chmod (tc->test_dir, 0777) >= 0); data/cockpit-231/src/ws/remotectl-certificate.c:113: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, mode) < 0) data/cockpit-231/src/ws/remotectl-certificate.c:118:7: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. if (chown (path, pwd->pw_uid, gr ? gr->gr_gid : -1) < 0) data/cockpit-231/src/bridge/cockpitblocksamples.c:95:20: [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. num_parsed = sscanf (line, data/cockpit-231/src/bridge/cockpitcgroupsamples.c:266:21: [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. cgroup_ver = (access ("/sys/fs/cgroup/cgroup.controllers", F_OK) == 0) ? 2 : 1; data/cockpit-231/src/bridge/cockpitcpusamples.c:71:15: [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. guint64 system; data/cockpit-231/src/bridge/cockpitcpusamples.c:79:11: [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 (line + sizeof ("cpu ") - 1, FMT64 FMT64 FMT64 FMT64 FMT64, data/cockpit-231/src/bridge/cockpitcpusamples.c:82:20: [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. &system, data/cockpit-231/src/bridge/cockpitcpusamples.c:93:66: [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. cockpit_samples_sample (samples, "cpu.basic.system", NULL, system*1000/user_hz); data/cockpit-231/src/bridge/cockpitdisksamples.c:106:20: [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. num_parsed = sscanf (line, data/cockpit-231/src/bridge/cockpitmemorysamples.c:59:25: [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. g_warn_if_fail (sscanf (line + sizeof ("MemTotal:") - 1, "%" G_GUINT64_FORMAT, &total_kb) == 1); data/cockpit-231/src/bridge/cockpitmemorysamples.c:61:25: [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. g_warn_if_fail (sscanf (line + sizeof ("MemFree:") - 1, "%" G_GUINT64_FORMAT, &free_kb) == 1); data/cockpit-231/src/bridge/cockpitmemorysamples.c:63:25: [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. g_warn_if_fail (sscanf (line + sizeof ("SwapTotal:") - 1, "%" G_GUINT64_FORMAT, &swap_total_kb) == 1); data/cockpit-231/src/bridge/cockpitmemorysamples.c:65:25: [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. g_warn_if_fail (sscanf (line + sizeof ("SwapFree:") - 1, "%" G_GUINT64_FORMAT, &swap_free_kb) == 1); data/cockpit-231/src/bridge/cockpitmemorysamples.c:67:25: [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. g_warn_if_fail (sscanf (line + sizeof ("Buffers:") - 1, "%" G_GUINT64_FORMAT, &buffers_kb) == 1); data/cockpit-231/src/bridge/cockpitmemorysamples.c:69:25: [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. g_warn_if_fail (sscanf (line + sizeof ("Cached:") - 1, "%" G_GUINT64_FORMAT, &cached_kb) == 1); data/cockpit-231/src/bridge/cockpitmemorysamples.c:71:25: [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. g_warn_if_fail (sscanf (line + sizeof ("MemAvailable:") - 1, "%" G_GUINT64_FORMAT, &available_kb) == 1); data/cockpit-231/src/bridge/cockpitnetworksamples.c:72:20: [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. num_parsed = sscanf (line, data/cockpit-231/src/bridge/cockpitpackages.c:572:29: [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. gboolean system) data/cockpit-231/src/bridge/cockpitpackages.c:610:7: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if (system) data/cockpit-231/src/bridge/test-packages.c:1035: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, 1, 2))) data/cockpit-231/src/bridge/test-packages.c:1046:13: [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. g_assert (system (cmd) == 0); data/cockpit-231/src/bridge/test-pcp-archives.c:41:13: [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. g_assert (system ("rm -rf mock-archives && mkdir mock-archives") == 0); data/cockpit-231/src/common/cockpitjsonprint.c:165:10: [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. return fprintf (stream, ", \"%s\": %"PRIu64, key, value) > 6; data/cockpit-231/src/common/cockpitpipe.c:1389:9: [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. execvp (argv[0], (char *const *)argv); data/cockpit-231/src/common/cockpittest.c:578:15: [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. execvp (args[0], args); data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c:88:7: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. syslog (LOG_INFO | LOG_AUTHPRIV, "pam_ssh_add: " format, ##__VA_ARGS__); \ data/cockpit-231/src/retest/retest.c:213:3: [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.x.test.name, sizeof (item.x.test.name), name, va); data/cockpit-231/src/retest/retest.c:233:3: [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.x.test.name, sizeof (item.x.test.name), name, va); data/cockpit-231/src/ssh/mock-sshd.c:311:7: [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 ("/bin/bash", "/bin/bash", NULL); data/cockpit-231/src/ssh/mock-sshd.c:362:7: [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 ("/bin/sh", "/bin/sh", "-c", cmd, NULL); data/cockpit-231/src/tls/socket-activation-helper.c:143:7: [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. execv (ws_path, (char **) args); data/cockpit-231/src/tls/test-server.c:290:32: [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. g_assert_cmpint (access (tc->cert_file_path, F_OK), ==, -1); data/cockpit-231/src/tls/test-server.c:308:20: [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. g_assert_cmpint (access (tc->cert_file_path, F_OK), ==, -1); data/cockpit-231/src/tls/test-server.c:617:24: [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. g_assert_cmpint (access (tc->cert_file_path, F_OK), ==, -1); data/cockpit-231/src/tls/test-server.c:657:27: [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 (tc->cert_file_path, F_OK) == 0) data/cockpit-231/src/tls/test-server.c:664:28: [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. g_assert_cmpint (access (tc->cert_file_path, F_OK), ==, 0); data/cockpit-231/src/tls/test-server.c:685:19: [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 (tc->cert_file_path, F_OK) == 0) data/cockpit-231/src/tls/test-server.c:695:28: [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. g_assert_cmpint (access (tc->cert_file_path, F_OK), ==, 0); data/cockpit-231/src/tls/test-server.c:703:15: [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 (tc->cert_file_path, F_OK) < 0) data/cockpit-231/src/tls/test-server.c:707:24: [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. g_assert_cmpint (access (tc->cert_file_path, F_OK), ==, -1); data/cockpit-231/src/tls/utils.h:43:56: [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. #define debug(domain, fmt, ...) do if (DEBUG_##domain) fprintf (stderr, __FILE__ ": " fmt "\n", ##__VA_ARGS__); while (0) data/cockpit-231/src/ws/cockpitbranding.c:45:24: [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. const gchar * const* system; data/cockpit-231/src/ws/cockpitbranding.c:47:10: [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. while (system && system[0]) data/cockpit-231/src/ws/cockpitbranding.c:47:20: [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. while (system && system[0]) data/cockpit-231/src/ws/cockpitbranding.c:49:48: [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. g_ptr_array_add (dirs, g_build_filename (system[0], "cockpit", "static", NULL)); data/cockpit-231/src/ws/cockpitcompat.c:126:12: [4] (crypto) crypt_r: 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. secret = crypt_r (password, salt, cd + 0); data/cockpit-231/src/ws/cockpitcompat.c:134:10: [4] (crypto) crypt_r: 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. resp = crypt_r (secret, nonce, cd + 1); data/cockpit-231/src/ws/mock-auth-command.c:324:9: [4] (shell) execlp: 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. execlp (BUILDDIR "/cockpit-bridge", BUILDDIR "/cockpit-bridge", NULL); data/cockpit-231/src/ws/mock-auth-command.c:326:9: [4] (shell) execlp: 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. execlp ("cat", "cat", NULL); data/cockpit-231/src/ws/pam_cockpit_cert.c:43:48: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. #define debug(format, ...) { if (enable_debug) syslog (LOG_DEBUG, "pam_cockpit_cert: " format, ##__VA_ARGS__); } data/cockpit-231/src/ws/pam_cockpit_cert.c:44:28: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. #define error(format, ...) syslog (LOG_ERR, "pam_cockpit_cert: " format, ##__VA_ARGS__) data/cockpit-231/src/ws/session-utils.c:740:25: [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/cockpit-231/src/ws/session-utils.c:748:19: [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. size_t length = vsnprintf (buffer, sizeof buffer, format, ap); data/cockpit-231/src/ws/session.c:419:50: [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. (!getenv ("COCKPIT_TEST_KEEP_KTAB") && access (COCKPIT_KTAB, F_OK) == 0) ? &cockpit_ktab_store : NULL, data/cockpit-231/src/bridge/cockpitconnect.c:621:30: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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 g_build_filename (g_get_home_dir (), filename, NULL); data/cockpit-231/src/bridge/cockpitpcpmetrics.c:862: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. prefix = getenv("PCP_DIR"); data/cockpit-231/src/bridge/cockpitpcpmetrics.c:863: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. conf = getenv("PCP_CONF"); data/cockpit-231/src/bridge/test-peer.c:553:45: [3] (buffer) g_get_tmp_dir: This function is synonymous with 'getenv("TMP")';it returns untrustable input if the environment can beset by an attacker. It 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. link = g_strdup_printf ("%s/mock-bridge", g_get_tmp_dir ()); data/cockpit-231/src/common/cockpitconf.c:296:19: [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 ("XDG_CONFIG_DIRS"); data/cockpit-231/src/common/cockpithacks.h:73: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. return RUNNING_ON_VALGRIND || getenv ("COCKPIT_HACKS_VALGRIND_MEMFD_WORKAROUND"); data/cockpit-231/src/common/cockpitwebresponse.c:1287:14: [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. path = realpath (input[i], NULL); data/cockpit-231/src/common/preload-temp-home.c:59:23: [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. pwd->pw_dir = getenv("HOME"); data/cockpit-231/src/common/test-webresponse.c:285:17: [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. gchar *root = realpath ( SRCDIR "/src", NULL); data/cockpit-231/src/common/test-webresponse.c:301:17: [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. gchar *root = realpath ( SRCDIR "/src", NULL); data/cockpit-231/src/common/test-webresponse.c:317:17: [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. gchar *root = realpath ( SRCDIR "/src", NULL); data/cockpit-231/src/common/test-webresponse.c:333:17: [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. gchar *root = realpath ( SRCDIR "/src", NULL); data/cockpit-231/src/common/test-webresponse.c:1451: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. srcdir = realpath (SRCDIR, NULL); data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c:377: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. return getenv (name); data/cockpit-231/src/pam-ssh-add/test-ssh-add.c:106:20: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env_saved[i] = getenv (env_names[i]); data/cockpit-231/src/pam-ssh-add/test-ssh-add.c:218:43: [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. run_test_agent_environment (data, NULL, getenv ("XDG_RUNTIME_DIR")); data/cockpit-231/src/ssh/cockpitsshrelay.c:946:53: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. identity = g_strdup_printf ("%s/.ssh/%s", g_get_home_dir (), default_identities[i]); data/cockpit-231/src/ssh/cockpitsshrelay.c:2328:56: [3] (buffer) g_get_home_dir: This function is synonymous with 'getenv("HOME")';it returns untrustable input if the environment can beset by an attacker. It 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. self->ssh_data->user_known_hosts = g_build_filename (g_get_home_dir (), ".ssh/known_hosts", NULL); data/cockpit-231/src/websocket/websocketclient.c:225:12: [3] (random) g_random_int: 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. raw[0] = g_random_int (); data/cockpit-231/src/websocket/websocketclient.c:226:12: [3] (random) g_random_int: 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. raw[1] = g_random_int (); data/cockpit-231/src/websocket/websocketclient.c:227:12: [3] (random) g_random_int: 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. raw[2] = g_random_int (); data/cockpit-231/src/websocket/websocketclient.c:228:12: [3] (random) g_random_int: 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. raw[3] = g_random_int (); data/cockpit-231/src/websocket/websocketconnection.c:433:22: [3] (random) g_random_int: 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. guint32 rand = g_random_int (); data/cockpit-231/src/ws/cockpitauth.c:1415:7: [3] (random) g_random_int_range: 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. r = g_random_int_range (0, 100); data/cockpit-231/src/ws/cockpitcertificate.c:141:34: [3] (buffer) g_get_tmp_dir: This function is synonymous with 'getenv("TMP")';it returns untrustable input if the environment can beset by an attacker. It 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. ssl_config = create_temp_file (g_get_tmp_dir (), "ssl.conf.XXXXXX", error); data/cockpit-231/src/ws/cockpitwebservice.c:659:19: [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. superuser = getenv("COCKPIT_SUPERUSER") ?: cockpit_creds_get_superuser (self->creds); data/cockpit-231/src/ws/session-utils.c:714: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. if (!getenv ("COCKPIT_TEST_KEEP_PATH")) data/cockpit-231/src/ws/session-utils.c:719: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. value = getenv (env_names[i]); data/cockpit-231/src/ws/session.c:419:13: [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 ("COCKPIT_TEST_KEEP_KTAB") && access (COCKPIT_KTAB, F_OK) == 0) ? &cockpit_ktab_store : NULL, data/cockpit-231/src/ws/session.c:645: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. rhost = getenv ("COCKPIT_REMOTE_PEER") ?: ""; data/cockpit-231/src/bridge/cockpitcgroupsamples.c:88: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[30]; data/cockpit-231/src/bridge/cockpitcgroupsamples.c:103: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[256]; data/cockpit-231/src/bridge/cockpitcgroupsamples.c:241: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). dfd = open (ent->fts_path, O_PATH | O_DIRECTORY); data/cockpit-231/src/bridge/cockpitconnect.c:483: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). if (open) data/cockpit-231/src/bridge/cockpitfsread.c:54: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). gboolean open; data/cockpit-231/src/bridge/cockpitfsread.c:121: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 (self->open) data/cockpit-231/src/bridge/cockpitfsread.c:225: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 (self->path, O_RDONLY); data/cockpit-231/src/bridge/cockpitfsread.c:299: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). if (self->open) data/cockpit-231/src/bridge/cockpitfsreplace.c:270:18: [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). self->fd = open (self->tmp_path, O_WRONLY | O_CREAT | O_EXCL, 0666); data/cockpit-231/src/bridge/cockpitpaths.c:155: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 ((gchar *)pd->data, path, key.len + 1); data/cockpit-231/src/bridge/cockpitpcpmetrics.c:874: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(conf, "r")) == NULL) data/cockpit-231/src/bridge/cockpitpipechannel.c:59: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). gboolean open; data/cockpit-231/src/bridge/cockpitpipechannel.c:103: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 (self->open) data/cockpit-231/src/bridge/cockpitpipechannel.c:232: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). if (self->open) data/cockpit-231/src/bridge/cockpitpipechannel.c:258: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 (self->open) data/cockpit-231/src/bridge/cockpitpipechannel.c:293: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). if (end_of_data && self->open) data/cockpit-231/src/bridge/cockpitpipechannel.c:528: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). if (self->open) data/cockpit-231/src/bridge/cockpitrouter.c:1120:50: [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). address = g_inet_socket_address_new (inet, atoi (port)); data/cockpit-231/src/bridge/cockpitstream.c:757:80: [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). G_STRUCT_OFFSET (CockpitStreamClass, open), data/cockpit-231/src/bridge/cockpitstream.h:51:18: [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) (CockpitStream *stream); data/cockpit-231/src/bridge/test-fs.c:351:15: [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). FILE *f = fopen (tc->test_path, "w"); data/cockpit-231/src/bridge/test-fs.c:382:15: [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). FILE *f = fopen (tc->test_path_2, "w"); data/cockpit-231/src/common/cockpitauthorize.c:112: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 ("/dev/urandom", O_RDONLY, 0); data/cockpit-231/src/common/cockpitbase64.c:211: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 input[3]; data/cockpit-231/src/common/cockpitbase64.c:212: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 output[4]; data/cockpit-231/src/common/cockpitconf.c:69: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 err[1024]; data/cockpit-231/src/common/cockpitconf.c:127: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). f = fopen (file_path, "r"); data/cockpit-231/src/common/cockpitjsonprint.c:234: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). int readonly_fd = open (fd_name, O_RDONLY); data/cockpit-231/src/common/cockpittest.c:543: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 buffer[256]; data/cockpit-231/src/common/cockpittest.c:661: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, "%u", (guint) getpid ()); data/cockpit-231/src/common/cockpitwebcertificate.c:160: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 (file, O_RDONLY); data/cockpit-231/src/common/test-base64.c:54: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 decoded[8192]; data/cockpit-231/src/common/test-jsonfds.c: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 buffer[1024]; data/cockpit-231/src/common/test-jsonfds.c:45: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 expected_buffer[1024]; data/cockpit-231/src/common/test-jsonfds.c:132: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 buffer[256]; data/cockpit-231/src/common/test-jsonfds.c:134: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[10]; data/cockpit-231/src/common/test-jsonfds.c:308: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. memcpy (region, buffer, i); data/cockpit-231/src/common/test-jsonfds.c:319:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (region, buffer, length); data/cockpit-231/src/common/test-jsonfds.c:421:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open ("/dev/null", O_RDONLY); data/cockpit-231/src/common/test-jsonfds.c:469: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 (procfile, O_WRONLY); data/cockpit-231/src/common/test-template.c:68: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 *output[8]; data/cockpit-231/src/common/test-webcertificate.c:78: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). cert_dir_fd = open (cert_dir, O_PATH); data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c:412: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. setup_child (const char **args, data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c:413: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. char **env, data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c:510: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. run_as_user (const char **args, data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c:511: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. char **env, data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c:596: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 *env[ENVIRON_SIZE] = { NULL }; data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c:718: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 *env[ENVIRON_SIZE] = { NULL }; data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c:739: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 *save_vars[N_ELEMENTS (agent_vars)] = { NULL, }; data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c:1034: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). pid = atoi (s_pid); data/cockpit-231/src/pam-ssh-add/test-ssh-add.c:51: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 *env_saved[N_ELEMENTS (env_names)] = { NULL, }; data/cockpit-231/src/retest/retest.c:64: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 name[1024]; data/cockpit-231/src/retest/retest.c:193: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 (item, it, sizeof (test_item)); data/cockpit-231/src/ssh/cockpitsshrelay.c:543: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 port_str[10]; data/cockpit-231/src/ssh/cockpitsshrelay.c:1348: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). guint value = atoi (port_str ?: ""); data/cockpit-231/src/ssh/cockpitsshrelay.c:2233: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 (&self->channel_cbs, &channel_cbs, sizeof (channel_cbs)); data/cockpit-231/src/ssh/mock-sshd.c:69: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 *prompts[2] = { "Password", "Token" }; data/cockpit-231/src/ssh/mock-sshd.c:71: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 *again[1] = { "So Close" }; data/cockpit-231/src/ssh/mock-sshd.c:555: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 portname[16]; data/cockpit-231/src/ssh/mock-sshd.c:556: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 addrname[16]; data/cockpit-231/src/ssh/test-sshbridge.c:90: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 ("/proc/net/if_inet6", O_RDONLY); data/cockpit-231/src/tls/certfile.c:52: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 digest_data[sizeof (Fingerprint) / 2]; data/cockpit-231/src/tls/connection.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 buffer[16u << 10]; /* 16KiB */ data/cockpit-231/src/tls/connection.c:208: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. ((char *) iov[i].iov_base - buffer), iov[i].iov_len, start); data/cockpit-231/src/tls/connection.c:231: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 (CMSG_DATA(cmsg), fd_to_send, sizeof *fd_to_send); data/cockpit-231/src/tls/connection.c:413: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 reply[20]; data/cockpit-231/src/tls/connection.c:459: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 sockname[80]; data/cockpit-231/src/tls/connection.c:730: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 ip[INET6_ADDRSTRLEN + 1 + IF_NAMESIZE + 1]; data/cockpit-231/src/tls/connection.c:949:35: [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). parameters.wsinstance_sockdir = open (wsinstance_sockdir, O_DIRECTORY | O_PATH); data/cockpit-231/src/tls/connection.c:953:33: [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). parameters.cert_session_dir = open (cert_session_dir, O_DIRECTORY | O_PATH); data/cockpit-231/src/tls/socket-activation-helper.c:44: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 *argv[MAX_COCKPIT_WS_ARGS]; data/cockpit-231/src/tls/socket-activation-helper.c:117:13: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 *args[MAX_COCKPIT_WS_ARGS + 1] = { ws_path }; data/cockpit-231/src/tls/socket-activation-helper.c:120: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 pid_str[10]; data/cockpit-231/src/tls/socket-activation-helper.c:230: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). int socket_dir_fd = open (socket_dir, O_RDONLY | O_DIRECTORY | O_CLOEXEC); data/cockpit-231/src/tls/test-certfile.c:142: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). testdir_fd = open (dirname, O_PATH); data/cockpit-231/src/tls/test-server.c:162: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[4096]; data/cockpit-231/src/tls/test-server.c:208: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[4096]; data/cockpit-231/src/tls/test-server.c:345: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). int socket_dir_fd = open (tc->ws_socket_dir, O_RDONLY | O_DIRECTORY); data/cockpit-231/src/tls/test-server.c:381: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). int socket_dir_fd = open (tc->ws_socket_dir, O_RDONLY | O_DIRECTORY); data/cockpit-231/src/tls/test-server.c:481: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[4096]; data/cockpit-231/src/tls/test-server.c:642:15: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-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[6]; data/cockpit-231/src/tls/utils.h:56:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str[64 + 1]; data/cockpit-231/src/tls/wsinstance-factory.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 unit[UNIT_MAX + 1]; data/cockpit-231/src/tls/wsinstance-start.c: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 result[20]; data/cockpit-231/src/tls/wsinstance-start.c:49: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). dirfd = open (wsinstance_sockdir, O_PATH | O_DIRECTORY | O_CLOEXEC); data/cockpit-231/src/websocket/websocketconnection.c:436: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 (mask, &rand, sizeof (guint32)); data/cockpit-231/src/websocket/websocketconnection.c:1474:76: [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). G_STRUCT_OFFSET (WebSocketConnectionClass, open), data/cockpit-231/src/websocket/websocketconnection.h:58: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). void (* open) (WebSocketConnection *self); data/cockpit-231/src/ws/cockpitchannelresponse.c:429: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). JsonObject *open; data/cockpit-231/src/ws/cockpitchannelresponse.c:440: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). cockpit_json_get_string (open, "path", NULL, &self->logname); data/cockpit-231/src/ws/cockpitchannelresponse.c:444:44: [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). payload = json_object_get_string_member (open, "payload"); data/cockpit-231/src/ws/cockpitchannelresponse.c:455:45: [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). cockpit_channel_control (channel, "open", open); data/cockpit-231/src/ws/cockpitchannelresponse.c:726:44: [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). JsonObject *open) data/cockpit-231/src/ws/cockpitchannelresponse.c:737:44: [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 (!cockpit_web_service_parse_external (open, &content_type, &content_encoding, &content_disposition, NULL)) data/cockpit-231/src/ws/cockpitchannelresponse.c:755:32: [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 (!json_object_has_member (open, "binary")) data/cockpit-231/src/ws/cockpitchannelresponse.c:756:36: [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). json_object_set_string_member (open, "binary", "raw"); data/cockpit-231/src/ws/cockpitchannelresponse.c:758:35: [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). json_object_set_boolean_member (open, "flow-control", TRUE); data/cockpit-231/src/ws/cockpitchannelresponse.c:762:46: [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 (!cockpit_web_service_parse_binary (open, &data_type)) data/cockpit-231/src/ws/cockpitchannelresponse.c:775: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). json_object_remove_member (open, "external"); data/cockpit-231/src/ws/cockpitchannelresponse.c:777:79: [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). self = cockpit_channel_response_new (service, response, transport, headers, open); data/cockpit-231/src/ws/cockpitchannelresponse.h:37:68: [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). JsonObject *open); data/cockpit-231/src/ws/cockpitchannelsocket.c:108: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). JsonObject *open; data/cockpit-231/src/ws/cockpitchannelsocket.c:117:45: [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). cockpit_channel_control (channel, "open", open); data/cockpit-231/src/ws/cockpitchannelsocket.c:191:42: [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). JsonObject *open, data/cockpit-231/src/ws/cockpitchannelsocket.c:205:44: [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 (!cockpit_web_service_parse_external (open, NULL, NULL, NULL, &protocols) || data/cockpit-231/src/ws/cockpitchannelsocket.c:206:42: [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). !cockpit_web_service_parse_binary (open, &data_type)) data/cockpit-231/src/ws/cockpitchannelsocket.c:219:35: [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). json_object_set_boolean_member (open, "flow-control", TRUE); data/cockpit-231/src/ws/cockpitchannelsocket.c:224:35: [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). "options", open, data/cockpit-231/src/ws/cockpitchannelsocket.h:29:67: [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). JsonObject *open, data/cockpit-231/src/ws/cockpithandlers.c:198:65: [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 (!cockpit_transport_parse_command (bytes, NULL, NULL, &open)) data/cockpit-231/src/ws/cockpithandlers.c:206: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). if (!open) data/cockpit-231/src/ws/cockpithandlers.c:220:49: [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). cockpit_channel_socket_open (service, open, original_path, path, io_stream, headers, input, data/cockpit-231/src/ws/cockpithandlers.c:229:70: [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). cockpit_channel_response_open (service, headers, response, open); data/cockpit-231/src/ws/cockpithandlers.c:232: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). json_object_unref (open); data/cockpit-231/src/ws/cockpitwebservice.h:73:75: [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). gboolean cockpit_web_service_parse_binary (JsonObject *open, data/cockpit-231/src/ws/cockpitwebservice.h:76:75: [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). gboolean cockpit_web_service_parse_external (JsonObject *open, data/cockpit-231/src/ws/cockpitwsinstancecert.c:51: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[1024]; data/cockpit-231/src/ws/cockpitwsinstancecert.c:57: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 ("/proc/self/cgroup", O_RDONLY | O_CLOEXEC | O_NOFOLLOW); data/cockpit-231/src/ws/cockpitwsinstancecert.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). dirfd = open ("/run/cockpit/tls", O_PATH | O_DIRECTORY | O_NOFOLLOW); data/cockpit-231/src/ws/mock-service.c:467: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 buffer[100]; data/cockpit-231/src/ws/pam_cockpit_cert.c:155: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 cert_pem[MAX_PEER_CERT_SIZE]; data/cockpit-231/src/ws/session-utils.c:195: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, str, len); data/cockpit-231/src/ws/session-utils.c:207: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 pwd_string_buf[8192]; data/cockpit-231/src/ws/session-utils.c:208: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 home_env_buf[8192]; data/cockpit-231/src/ws/session-utils.c:326: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_LASTLOG, O_RDWR); data/cockpit-231/src/ws/session-utils.c:394: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 (entry.ll_host, rhost, MIN (strlen (rhost), sizeof entry.ll_host)); data/cockpit-231/src/ws/session-utils.c:396: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 (entry.ll_line, line, MIN (strlen (line), sizeof entry.ll_line)); data/cockpit-231/src/ws/session-utils.c:434: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_BTMP, O_RDONLY | O_CLOEXEC); data/cockpit-231/src/ws/session-utils.c:504: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 id[UT_LINESIZE + 1]; data/cockpit-231/src/ws/session-utils.c:662: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). int fd = open (_PATH_BTMP, O_WRONLY | O_APPEND); data/cockpit-231/src/ws/session-utils.c:705: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 *env_saved[sizeof (env_names) / sizeof (env_names)[0]] = { NULL, }; data/cockpit-231/src/ws/session-utils.c:744: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 buffer[1024]; data/cockpit-231/src/ws/session-utils.c:782: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 (fds, remap_fds, sizeof (int) * n_remap_fds); data/cockpit-231/src/ws/session.c:51: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, str, len); data/cockpit-231/src/ws/session.c:61: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 buffer[1024]; data/cockpit-231/src/ws/test-server.c:496:73: [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 (!cockpit_transport_parse_command (bytes, NULL, NULL, &open)) data/cockpit-231/src/ws/test-server.c:505: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). if (open) data/cockpit-231/src/ws/test-server.c:510:53: [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). cockpit_channel_socket_open (service, open, path, path, io_stream, headers, input, FALSE /* for_tls_proxy */); data/cockpit-231/src/ws/test-server.c:517:74: [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). cockpit_channel_response_open (service, headers, response, open); data/cockpit-231/src/ws/test-server.c:522: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). json_object_unref (open); data/cockpit-231/src/ws/test-server.c:695:16: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int fd = atoi (address_fd_str); data/cockpit-231/src/ws/test-webservice.c:276: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 (data, "\n", 1); data/cockpit-231/src/bridge/askpass.c:97: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 (data); data/cockpit-231/src/bridge/bridge.c:238:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read (addrfd[0], address->str + len, 256); data/cockpit-231/src/bridge/bridge.c:521:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (022); data/cockpit-231/src/bridge/bridge.c:648:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (payload_types[i].name); data/cockpit-231/src/bridge/cockpitblocksamples.c:58: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). if (strlen (line) == 0) data/cockpit-231/src/bridge/cockpitcgroupsamples.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, bufsize); data/cockpit-231/src/bridge/cockpitcgroupsamples.c:106: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). size_t key_len = strlen (key); data/cockpit-231/src/bridge/cockpitcgroupsamples.c:225: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). gsize root_dir_len = strlen (root_dir); data/cockpit-231/src/bridge/cockpitdbususer.c:55: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). n = strlen (pw->pw_gecos); data/cockpit-231/src/bridge/cockpitdisksamples.c:69: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). if (strlen (line) == 0) data/cockpit-231/src/bridge/cockpitdisksamples.c:135: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). && g_ascii_isdigit (dev_name[strlen (dev_name) - 1])) data/cockpit-231/src/bridge/cockpitinteracttransport.c:135:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). self->delimiter_len = strlen (self->delimiter); data/cockpit-231/src/bridge/cockpitinteracttransport.c:175: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). self->delimiter_len = strlen (self->delimiter); data/cockpit-231/src/bridge/cockpitinteracttransport.c:220: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). prefix = g_bytes_new_take (prefix_str, strlen (prefix_str)); data/cockpit-231/src/bridge/cockpitmountsamples.c:57: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). if (strlen (line) == 0) data/cockpit-231/src/bridge/cockpitnetworksamples.c:69: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). if (n < 2 || strlen (line) == 0) data/cockpit-231/src/bridge/cockpitpackages.c:233: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). strlen (filename) + 1); data/cockpit-231/src/bridge/cockpitpackages.c:235: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). strlen (string) + 1); data/cockpit-231/src/bridge/cockpitpackages.c:237: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). strlen (filename) + 1); data/cockpit-231/src/bridge/cockpitpackages.c:239: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). strlen (string) + 1); data/cockpit-231/src/bridge/cockpitpackages.c:819: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). content = g_bytes_new (packages->checksum, strlen (packages->checksum)); data/cockpit-231/src/bridge/cockpitpackages.c:872: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). prefix = g_bytes_new_static (template, strlen (template)); data/cockpit-231/src/bridge/cockpitpaths.c:30: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). gsize length = strlen (parent); data/cockpit-231/src/bridge/cockpitpaths.c:49: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). gsize length = strlen (ancestor); data/cockpit-231/src/bridge/cockpitpaths.c:64: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). gsize length = strlen (ancestor); data/cockpit-231/src/bridge/cockpitpaths.c:147: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). PathData key = { strlen (path), path }; data/cockpit-231/src/bridge/cockpitpaths.c:167: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). PathData key = { strlen (path), path }; data/cockpit-231/src/bridge/cockpitpaths.c:175: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). PathData key = { strlen(path), path }; data/cockpit-231/src/bridge/cockpitpaths.c:184: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). PathData key = { strlen (path), path }; data/cockpit-231/src/bridge/cockpitpaths.c:193: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). PathData key = { strlen (path), path }; data/cockpit-231/src/bridge/cockpitpcp.c:47:49: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). GBytes *bytes = g_bytes_new_static (response, strlen (response)); data/cockpit-231/src/bridge/cockpitpcpmetrics.c:742: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). path[strlen(path)-strlen(".index")] = '\0'; data/cockpit-231/src/bridge/cockpitpcpmetrics.c:742: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). path[strlen(path)-strlen(".index")] = '\0'; data/cockpit-231/src/bridge/cockpitrouter.c:257: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). !g_pattern_match (match->glob, strlen (value), value, NULL)) data/cockpit-231/src/bridge/cockpitrouter.c:598: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). return g_bytes_new (value, strlen (value)); data/cockpit-231/src/bridge/cockpitrouter.c:633:59: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). GBytes *input = g_bytes_new_static (config_args[i], strlen(config_args[i]) + 1); data/cockpit-231/src/bridge/cockpitstream.c:444:30: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (self->priv->in_done || read) data/cockpit-231/src/bridge/cockpitstream.c:777:78: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). G_STRUCT_OFFSET (CockpitStreamClass, read), data/cockpit-231/src/bridge/cockpitstream.h:53:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void (* read) (CockpitStream *pipe, data/cockpit-231/src/bridge/test-fs.c:136: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). GBytes *bytes = g_bytes_new_static (str, strlen (str)); data/cockpit-231/src/bridge/test-fs.c:145: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). GBytes *bytes = g_bytes_new_static (message, strlen (message)); data/cockpit-231/src/bridge/test-httpstream.c:110: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). bytes = g_bytes_new_static (data, strlen (data)); data/cockpit-231/src/bridge/test-httpstream.c:156: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). bytes = g_bytes_new_static (control, strlen (control)); data/cockpit-231/src/bridge/test-httpstream.c:181: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). bytes = g_bytes_new_static (data, strlen (data)); data/cockpit-231/src/bridge/test-httpstream.c:219: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). bytes = g_bytes_new_static (control, strlen (control)); data/cockpit-231/src/bridge/test-httpstream.c:269: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). bytes = g_bytes_new_static (control, strlen (control)); data/cockpit-231/src/bridge/test-httpstream.c:388: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). bytes = g_bytes_new_static (control, strlen (control)); data/cockpit-231/src/bridge/test-httpstream.c:468: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). bytes = g_bytes_new_static (data, strlen (data)); data/cockpit-231/src/bridge/test-httpstream.c:546: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). bytes = g_bytes_new_static (control, strlen (control)); data/cockpit-231/src/bridge/test-httpstream.c:714: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). bytes = g_bytes_new_static (control, strlen (control)); data/cockpit-231/src/bridge/test-httpstream.c:779: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). bytes = g_bytes_new_static (control, strlen (control)); data/cockpit-231/src/bridge/test-httpstream.c:845: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). bytes = g_bytes_new_static (control, strlen (control)); data/cockpit-231/src/bridge/test-packages.c:161: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). bytes = g_bytes_new_static (control, strlen (control)); data/cockpit-231/src/bridge/test-packet-channel.c:270: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). a = g_bytes_new_take (big, strlen (big)); data/cockpit-231/src/bridge/test-packet-channel.c:275: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). b = g_bytes_new_take (too_big, strlen (too_big)); data/cockpit-231/src/bridge/test-packet-channel.c:293: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). c = g_bytes_new_take (maximum, strlen (maximum)); data/cockpit-231/src/bridge/test-packet-channel.c:300: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). cockpit_assert_bytes_eq (sent, big, strlen (big)); data/cockpit-231/src/bridge/test-packet-channel.c:306: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). cockpit_assert_bytes_eq (sent, too_big, strlen (too_big)); data/cockpit-231/src/bridge/test-packet-channel.c:309: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). cockpit_assert_bytes_eq (sent, maximum, strlen (maximum)); data/cockpit-231/src/bridge/test-peer.c:263: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). GBytes *bytes = g_bytes_new (string, strlen (string)); data/cockpit-231/src/bridge/test-pipe-channel.c:608: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 (s); data/cockpit-231/src/bridge/test-router.c:151: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). GBytes *bytes = g_bytes_new (string, strlen (string)); data/cockpit-231/src/common/cockpitassets.c:546:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). __pragma(section(".CRT$XCU",read)) \ data/cockpit-231/src/common/cockpitassets.c:554:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). __pragma(section(".CRT$XCU",read)) \ data/cockpit-231/src/common/cockpitassets.c:566:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). section(".CRT$XCU",read) data/cockpit-231/src/common/cockpitassets.c:573:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). section(".CRT$XCU",read) data/cockpit-231/src/common/cockpitauthorize.c:128:21: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read_result = read (fd, key + read_bytes, length - read_bytes); data/cockpit-231/src/common/cockpitauthorize.c:332: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). clen = strlen (content); data/cockpit-231/src/common/cockpitauthorize.c:555: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 (conv) == 0) data/cockpit-231/src/common/cockpitauthorize.c:562: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). plen = strlen (prompt); data/cockpit-231/src/common/cockpitconf.c:344: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). for (char *c = entry->strv_value + strlen (entry->strv_value) - 1; c >= entry->strv_value && isspace (*c); --c) data/cockpit-231/src/common/cockpitframe.c:125:60: [1] (buffer) strlen: Does not handle 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 = cockpit_fd_write_all (fd, (unsigned char *)prefix, strlen (prefix)); data/cockpit-231/src/common/cockpitframe.c:178:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). res = read (fd, buf + buflen, 1); data/cockpit-231/src/common/cockpithex.c:38: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). length = strlen (data); data/cockpit-231/src/common/cockpithex.c:63: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). hexlen = strlen (hex); data/cockpit-231/src/common/cockpitjson.c:657: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 (str); data/cockpit-231/src/common/cockpitjsonprint.c:121: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 expected = strlen (key) + 7; data/cockpit-231/src/common/cockpitjsonprint.c:144:25: [1] (buffer) strlen: Does not handle 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 expected = 6 + strlen (key) + (value ? 4 : 5); /* "true" or "false" */ data/cockpit-231/src/common/cockpitlocale.c:81: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 (value) > sizeof (previous) - 1) data/cockpit-231/src/common/cockpitlocale.c:105:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (previous, value, sizeof (previous) - 1); data/cockpit-231/src/common/cockpitmemory.c:57: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 (data); data/cockpit-231/src/common/cockpitpipe.c:331:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read (priv->in_fd, priv->in_buffer->data + len, DEF_PACKET_SIZE); data/cockpit-231/src/common/cockpitpipe.c:398:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read (priv->err_fd, priv->err_buffer->data + len, 1024); data/cockpit-231/src/common/cockpitpipe.c:970:76: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). G_STRUCT_OFFSET (CockpitPipeClass, read), data/cockpit-231/src/common/cockpitpipe.c:1649: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 (variable); data/cockpit-231/src/common/cockpitpipe.h:42:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void (* read) (CockpitPipe *pipe, data/cockpit-231/src/common/cockpitpipetransport.c:235: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). channel_len = channel_id ? strlen (channel_id) : 0; data/cockpit-231/src/common/cockpitpipetransport.c:241: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). prefix = g_bytes_new_take (prefix_str, strlen (prefix_str)); data/cockpit-231/src/common/cockpitsystem.c:94: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). len = strlen (val); data/cockpit-231/src/common/cockpittemplate.c:46:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). a = memmem (data, strlen(data), start_marker, strlen (start_marker)); data/cockpit-231/src/common/cockpittemplate.c:46: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). a = memmem (data, strlen(data), start_marker, strlen (start_marker)); data/cockpit-231/src/common/cockpittemplate.c:50: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). data = a + strlen (start_marker); data/cockpit-231/src/common/cockpittemplate.c:53:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). c = memmem (data, strlen(data), end_marker, strlen (end_marker)); data/cockpit-231/src/common/cockpittemplate.c:53:51: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). c = memmem (data, strlen(data), end_marker, strlen (end_marker)); data/cockpit-231/src/common/cockpittemplate.c:57: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). data = c + strlen (end_marker); data/cockpit-231/src/common/cockpittest.c:356: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). len = strlen (string); data/cockpit-231/src/common/cockpittest.c:484: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 (data ?: ""); data/cockpit-231/src/common/cockpittest.c:486: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). exp_len = strlen (expect ?: ""); data/cockpit-231/src/common/cockpittest.c:615:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (out_fd[0], &c, 1)) data/cockpit-231/src/common/cockpittransport.c:463: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). strcspn (*channel, "\n") == strlen (*channel)); data/cockpit-231/src/common/cockpitwebcertificate.c:48: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 (entry->d_name); data/cockpit-231/src/common/cockpitwebcertificate.c:125: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 (certfile); data/cockpit-231/src/common/cockpitwebcertificate.c:186:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (fd, data, buf.st_size); data/cockpit-231/src/common/cockpitwebcertificate.c:233: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). end += strlen (footer); data/cockpit-231/src/common/cockpitwebinject.c:213: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 (marker); data/cockpit-231/src/common/cockpitwebresponse.c:251: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). offset = strlen (original_path) - strlen (path); data/cockpit-231/src/common/cockpitwebresponse.c:251: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). offset = strlen (original_path) - strlen (path); data/cockpit-231/src/common/cockpitwebresponse.c:540: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). bytes = g_bytes_new_take (data, strlen (data)); data/cockpit-231/src/common/cockpitwebresponse.c:1082: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). return g_bytes_new (message, strlen (message)); data/cockpit-231/src/common/cockpitwebresponse.c:1093: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). return g_bytes_new (value, strlen (value)); data/cockpit-231/src/common/cockpitwebresponse.c:1186:59: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). input = g_bytes_new_static (default_failure_template, strlen (default_failure_template)); data/cockpit-231/src/common/cockpitwebresponse.c:1266: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 (prefix); data/cockpit-231/src/common/cockpitwebresponse.c:1542:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). gsize inl, outl, read, written; data/cockpit-231/src/common/cockpitwebresponse.c:1556:64: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). G_CONVERTER_INPUT_AT_END, &read, &written, error); data/cockpit-231/src/common/cockpitwebresponse.c:1561:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). in += read; data/cockpit-231/src/common/cockpitwebresponse.c:1562:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). inl -= read; data/cockpit-231/src/common/cockpitwebresponse.c:1848: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). pos += strlen (origin) + 1; data/cockpit-231/src/common/cockpitwebserver.c:535: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). diff = strlen (header) - strlen (pos); data/cockpit-231/src/common/cockpitwebserver.c:535: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). diff = strlen (header) - strlen (pos); data/cockpit-231/src/common/cockpitwebserver.c:549: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). pos += strlen (name); data/cockpit-231/src/common/cockpitwebserver.c:555: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). end = value + strlen (value); data/cockpit-231/src/common/cockpitwebserver.c:749: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). length = strlen (body); data/cockpit-231/src/common/test-base64.c:58: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). input_len = strlen (input); data/cockpit-231/src/common/test-base64.c:60: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). expected_len = strlen ((char *)expected); data/cockpit-231/src/common/test-channel.c:197: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). control = g_bytes_new_static (data, strlen (data)); data/cockpit-231/src/common/test-json.c:405:14: [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. gboolean equal; data/cockpit-231/src/common/test-json.c:486:51: [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. g_assert (cockpit_json_equal (a, b) == fixture->equal); data/cockpit-231/src/common/test-json.c:530: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). g_assert_cmpuint (length, ==, strlen (fixture->expect)); data/cockpit-231/src/common/test-jsonfds.c:118: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). g_assert_cmpint (strlen (fixture->buffer), ==, ftell (fixture->stream)); data/cockpit-231/src/common/test-template.c:60: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). return g_bytes_new (value, strlen (value)); data/cockpit-231/src/common/test-template.c:102: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). input = g_bytes_new_static (fixture->input, strlen (fixture->input)); data/cockpit-231/src/common/test-transport.c:636: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). message = g_bytes_new_static (input, strlen (input)); data/cockpit-231/src/common/test-transport.c:659: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). message = g_bytes_new_static (input, strlen (input)); data/cockpit-231/src/common/test-transport.c:680: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). message = g_bytes_new_static (input, strlen (input)); data/cockpit-231/src/common/test-transport.c:715: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). message = g_bytes_new_static (input, strlen (input)); data/cockpit-231/src/common/test-unicode.c:43: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). input = g_bytes_new_static (fixture->input, strlen (fixture->input)); data/cockpit-231/src/common/test-unicode.c:60: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). input = g_bytes_new_static (fixture->input, strlen (fixture->input)); data/cockpit-231/src/common/test-webresponse.c:365: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). length = strlen (resp); data/cockpit-231/src/common/test-webresponse.c:436: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). length = strlen (resp); data/cockpit-231/src/common/test-webresponse.c:708: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). return g_bytes_new_static (data, strlen (data)); data/cockpit-231/src/common/test-webresponse.c:833: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 (string); data/cockpit-231/src/common/test-webresponse.c:837: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). block = g_bytes_new_static (string + i, MIN (x, strlen (string + i))); data/cockpit-231/src/common/test-webserver.c:376: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). g_output_stream_write_all_async (output, request, strlen (request), G_PRIORITY_DEFAULT, NULL, data/cockpit-231/src/common/test-webserver.c:451: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). bytes = g_bytes_new_static (data, strlen (data)); data/cockpit-231/src/common/test-webserver.c:522: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). g_assert_cmpint (strlen (big_header), ==, 7000); data/cockpit-231/src/common/test-webserver.c:523: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). g_assert_cmpint (big_header[strlen (big_header) - 1], ==, '1'); data/cockpit-231/src/common/test-webserver.c:691: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). bytes = g_bytes_new_take (data, strlen (data)); data/cockpit-231/src/common/test-webserver.c:711: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). bytes = g_bytes_new_static (data, strlen (data)); data/cockpit-231/src/common/test-webserver.c:731: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). bytes = g_bytes_new_static (data, strlen (data)); data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c:302:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (fd, ret + len, BLOCK-1); data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c:328: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 res, len = strlen (buf); data/cockpit-231/src/pam-ssh-add/pam-ssh-add.c:877: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 (password); data/cockpit-231/src/ssh/cockpitsshrelay.c:562: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 (exit == 0 && strlen (sout) > 0) data/cockpit-231/src/ssh/cockpitsshrelay.c:806: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). cockpit_memory_clear (password, strlen (password)); data/cockpit-231/src/ssh/cockpitsshrelay.c:843: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). cockpit_memory_clear (password, strlen (password)); data/cockpit-231/src/ssh/cockpitsshrelay.c:1527: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). memset (data->initial_auth_data, 0, strlen (data->initial_auth_data)); data/cockpit-231/src/ssh/mock-sshd.c:182:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bytes = read (fd, buf, ws); data/cockpit-231/src/ssh/test-sshbridge.c:94:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). avail = read (fd, &c, 1) == 1; data/cockpit-231/src/ssh/test-sshbridge.c:111:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read (fd, input->str + len, 256); data/cockpit-231/src/ssh/test-sshbridge.c:523: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). encoded = g_base64_encode ((guchar *)userpass, strlen (userpass)); data/cockpit-231/src/ssh/test-sshbridge.c:722: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). encoded = g_base64_encode ((guchar *)response, strlen (response)); data/cockpit-231/src/tls/connection.c:434: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). if (!send_all (fd, fingerprint->str, strlen (fingerprint->str), 5 * 1000000)) data/cockpit-231/src/tls/connection.c:755: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). size_t iplen = strlen (ip); data/cockpit-231/src/tls/connection.c:877: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). cert.size = strlen ((char*) cert.data); data/cockpit-231/src/tls/connection.c:878: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). key.size = strlen ((char*) key.data); data/cockpit-231/src/tls/socket-activation-helper.c:175: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). if (!send_all (fd, result, strlen (result), 10 * 1000000)) data/cockpit-231/src/tls/socket-activation-helper.c:196:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). s = read (fd, &b, 1); data/cockpit-231/src/tls/test-certfile.c:76:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). s = read (socket_fd, &b, sizeof b); data/cockpit-231/src/tls/test-server.c:143: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). g_assert_cmpint (write (fd, request, strlen (request)), ==, strlen (request)); data/cockpit-231/src/tls/test-server.c:143:63: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). g_assert_cmpint (write (fd, request, strlen (request)), ==, strlen (request)); data/cockpit-231/src/tls/wsinstance-factory.c:58: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). send_all (SD_LISTEN_FDS_START, result, strlen (result), 5 * 1000000); data/cockpit-231/src/tls/wsinstance-start.c:60: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 (!send_all (fd, argv[1], strlen (argv[1]), 50 * 1000000)) data/cockpit-231/src/websocket/test-websocket.c:153: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). ret = web_socket_util_parse_req_line (reqs[i], strlen (reqs[i]), &method, &path); data/cockpit-231/src/websocket/test-websocket.c:154: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). g_assert_cmpint (ret, ==, strlen (reqs[i]) - 2); data/cockpit-231/src/websocket/test-websocket.c:168: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). ret = web_socket_util_parse_req_line (data, strlen (data), NULL, NULL); data/cockpit-231/src/websocket/test-websocket.c:178: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). ret = web_socket_util_parse_req_line (data, strlen (data), NULL, NULL); data/cockpit-231/src/websocket/test-websocket.c:199: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). ret = web_socket_util_parse_req_line (bads[i], strlen (bads[i]), NULL, NULL); data/cockpit-231/src/websocket/test-websocket.c:220:58: [1] (buffer) strlen: Does not handle 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 = web_socket_util_parse_status_line (lines[i], strlen (lines[i]), NULL, &status, &reason); data/cockpit-231/src/websocket/test-websocket.c:221: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). g_assert_cmpint (ret, ==, strlen (lines[i]) - 2); data/cockpit-231/src/websocket/test-websocket.c:234: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). ret = web_socket_util_parse_status_line (line, strlen (line), NULL, NULL, NULL); data/cockpit-231/src/websocket/test-websocket.c:235: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). g_assert_cmpint (ret, ==, strlen (line) - 2); data/cockpit-231/src/websocket/test-websocket.c:244: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). ret = web_socket_util_parse_status_line (data, strlen (data), NULL, NULL, NULL); data/cockpit-231/src/websocket/test-websocket.c:263:58: [1] (buffer) strlen: Does not handle 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 = web_socket_util_parse_status_line (lines[i], strlen (lines[i]), NULL, NULL, NULL); data/cockpit-231/src/websocket/test-websocket.c:276: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). ret = web_socket_util_parse_status_line (line, strlen (line), &version, NULL, NULL); data/cockpit-231/src/websocket/test-websocket.c:277: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). g_assert_cmpint (ret, ==, strlen (line) - 2); data/cockpit-231/src/websocket/test-websocket.c:290: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). ret = web_socket_util_parse_status_line (line, strlen (line), &version, NULL, NULL); data/cockpit-231/src/websocket/test-websocket.c:291: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). g_assert_cmpint (ret, ==, strlen (line) - 2); data/cockpit-231/src/websocket/test-websocket.c:311: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). ret = web_socket_util_parse_headers (input, strlen (input), &headers); data/cockpit-231/src/websocket/test-websocket.c:312: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). g_assert_cmpint (ret, ==, strlen (input) - 6); data/cockpit-231/src/websocket/test-websocket.c:334: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). ret = web_socket_util_parse_headers (input, strlen (input), NULL); data/cockpit-231/src/websocket/test-websocket.c:335: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). g_assert_cmpint (ret, ==, strlen (input) - 6); data/cockpit-231/src/websocket/test-websocket.c:348: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). ret = web_socket_util_parse_headers (input, strlen (input), NULL); data/cockpit-231/src/websocket/test-websocket.c:372: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). ret = web_socket_util_parse_headers (input[i], strlen (input[i]), NULL); data/cockpit-231/src/websocket/websocket.c:153: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). length = strlen (string); data/cockpit-231/src/websocket/websocket.c:423: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). !g_ascii_isalnum (at[strlen (word)])) data/cockpit-231/src/websocket/websocketserver.c:70:57: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). g_strdup (bad_request), strlen (bad_request), 0); data/cockpit-231/src/websocket/websocketserver.c:91:57: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). g_strdup (bad_request), strlen (bad_request), 0); data/cockpit-231/src/websocket/websocketserver.c:129: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 (key); data/cockpit-231/src/ws/cockpitauth.c:471: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). gint len = strlen (prefix); data/cockpit-231/src/ws/cockpitauth.c:960: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). password = g_bytes_new_take (raw, strlen (raw)); data/cockpit-231/src/ws/cockpitauth.c:979: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). cockpit_memory_clear (raw, strlen (raw)); data/cockpit-231/src/ws/cockpitauth.c:1596:68: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). cookie_b64 = g_base64_encode ((guint8 *)session->cookie, strlen (session->cookie)); data/cockpit-231/src/ws/cockpithandlers.c:183: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). seglen = strlen (segment); data/cockpit-231/src/ws/cockpithandlers.c:188: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 (expected) != seglen || memcmp (expected, segment, seglen) != 0) data/cockpit-231/src/ws/cockpithandlers.c:363:57: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). g_byte_array_prepend (buffer, (const guint8 *)prefix, strlen (prefix)); data/cockpit-231/src/ws/cockpithandlers.c:364: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). g_byte_array_append (buffer, (const guint8 *)suffix, strlen (suffix)); data/cockpit-231/src/ws/cockpithandlers.c:406: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). url_bytes = g_bytes_new_take (base, strlen(base)); data/cockpit-231/src/ws/cockpithandlers.c:737: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). content = g_bytes_new_static (body, strlen (body)); data/cockpit-231/src/ws/cockpitwebservice.c:442: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). bytes = g_bytes_new_with_free_func (password, strlen (password), data/cockpit-231/src/ws/cockpitwebservice.c:784: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). prefix = g_bytes_new_take (string, strlen (string)); data/cockpit-231/src/ws/cockpitwsinstancecert.c:65:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (fd, buf, sizeof buf); data/cockpit-231/src/ws/cockpitwsinstancecert.c:195: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). if (strlen (contents) != buf.st_size) data/cockpit-231/src/ws/mock-auth-command.c:49: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). size_t auth_prefix_size = strlen (auth_prefix); data/cockpit-231/src/ws/mock-auth-command.c:50: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). size_t auth_suffix_size = strlen (auth_suffix); data/cockpit-231/src/ws/mock-auth-command.c:89:69: [1] (buffer) strlen: Does not handle 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 (cockpit_frame_write (STDOUT_FILENO, (unsigned char *)message, strlen (message)) < 0) data/cockpit-231/src/ws/mock-auth-command.c:97:69: [1] (buffer) strlen: Does not handle 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 (cockpit_frame_write (STDOUT_FILENO, (unsigned char *)message, strlen (message)) < 0) data/cockpit-231/src/ws/mock-auth.c:40: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). encoded = g_base64_encode ((guchar *)userpass, strlen (userpass)); data/cockpit-231/src/ws/mock-auth.c:66: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). g_assert (strncmp (cookie, expected, strlen(expected)) == 0); data/cockpit-231/src/ws/mock-echo.c:40:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). count = read (0, buffer, sizeof (buffer)); data/cockpit-231/src/ws/mock-service.c:466:25: [1] (buffer) strlen: Does not handle 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 expected_len = strlen (expected); data/cockpit-231/src/ws/mock-service.c:472:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = read (fd, buffer, 100); data/cockpit-231/src/ws/mock-service.c:500: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). size_t data_size = strlen (data); data/cockpit-231/src/ws/session-utils.c:119: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). auth_prefix_size = strlen (auth_prefix); data/cockpit-231/src/ws/session-utils.c:176:69: [1] (buffer) strlen: Does not handle 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 (cockpit_frame_write (STDOUT_FILENO, (unsigned char *)payload, strlen (payload)) < 0) data/cockpit-231/src/ws/session-utils.c:394: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 (entry.ll_host, rhost, MIN (strlen (rhost), sizeof entry.ll_host)); data/cockpit-231/src/ws/session-utils.c:396: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). memcpy (entry.ll_line, line, MIN (strlen (line), sizeof entry.ll_line)); data/cockpit-231/src/ws/session-utils.c:454:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = read (fd, &entry, sizeof entry); data/cockpit-231/src/ws/session-utils.c:519:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ut.ut_id, id, sizeof (ut.ut_id)); data/cockpit-231/src/ws/session-utils.c:522: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 (ut.ut_line, "web console", sizeof ut.ut_line); data/cockpit-231/src/ws/session-utils.c:527:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ut.ut_user, pwd->pw_name, sizeof(ut.ut_user)); data/cockpit-231/src/ws/session-utils.c:529:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (ut.ut_host, rhost, sizeof(ut.ut_host)); data/cockpit-231/src/ws/session-utils.c:659:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (entry.ut_host, rhost, sizeof entry.ut_host); data/cockpit-231/src/ws/session-utils.c:660:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (entry.ut_user, username, sizeof entry.ut_user); data/cockpit-231/src/ws/session.c:303: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). cockpit_memory_clear (password, strlen (password)); data/cockpit-231/src/ws/session.c:643:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (077); data/cockpit-231/src/ws/test-auth.c:771: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). if (g_ascii_strncasecmp (line, "X-Conversation ", strlen("X-Conversation ")) != 0) data/cockpit-231/src/ws/test-auth.c:836: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). out = g_base64_encode ((guint8 *)header, strlen (header)); data/cockpit-231/src/ws/test-auth.c:922: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). out = g_base64_encode ((guint8 *)header, strlen (header)); data/cockpit-231/src/ws/test-authssh.c:60:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read (fd, input->str + len, 256); data/cockpit-231/src/ws/test-channelresponse.c:124: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). password = g_bytes_new_take (g_strdup (PASSWORD), strlen (PASSWORD)); data/cockpit-231/src/ws/test-channelresponse.c:175: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 (haystack) != strlen (sewing_kit)) data/cockpit-231/src/ws/test-channelresponse.c:175: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 (strlen (haystack) != strlen (sewing_kit)) data/cockpit-231/src/ws/test-kerberos.c:293: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). input.length = strlen (input.value) + 1; data/cockpit-231/src/ws/test-kerberos.c:403:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read (out_fd, input->str + len, 256); data/cockpit-231/src/ws/test-server.c:130: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). bytes = g_bytes_new (qs, strlen (qs)); data/cockpit-231/src/ws/test-server.c:149: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). bytes = g_bytes_new_take (string, strlen (string)); data/cockpit-231/src/ws/test-server.c:226: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). bytes = g_bytes_new_take (output, strlen (output)); data/cockpit-231/src/ws/test-server.c:486: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). query = segment + strlen (segment); data/cockpit-231/src/ws/test-server.c:490: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). if (strlen(expected) == seglen && memcmp (expected, segment, seglen) == 0) data/cockpit-231/src/ws/test-server.c:542: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). inject = g_bytes_new (line, strlen (line)); data/cockpit-231/src/ws/test-server.c:560: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). block = g_bytes_new_static (data, strlen (data)); data/cockpit-231/src/ws/test-server.c:696: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). int r = write (fd, url, strlen (url)); data/cockpit-231/src/ws/test-server.c:698: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). g_assert (r == strlen (url)); data/cockpit-231/src/ws/test-webservice.c:155: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). password = g_bytes_new_take (g_strdup (PASSWORD), strlen (PASSWORD)); data/cockpit-231/src/ws/test-webservice.c:1156: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). message = g_bytes_new_static (data, strlen (data)); ANALYSIS SUMMARY: Hits = 484 Lines analyzed = 98717 in approximately 2.89 seconds (34197 lines/second) Physical Source Lines of Code (SLOC) = 72119 Hits@level = [0] 68 [1] 255 [2] 142 [3] 30 [4] 52 [5] 5 Hits@level+ = [0+] 552 [1+] 484 [2+] 229 [3+] 87 [4+] 57 [5+] 5 Hits/KSLOC@level+ = [0+] 7.65402 [1+] 6.71113 [2+] 3.17531 [3+] 1.20634 [4+] 0.79036 [5+] 0.0693299 Symlinks skipped = 1 (--allowlink overrides but see doc for security issue) 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.