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/dconf-0.38.0/bin/dconf.c Examining data/dconf-0.38.0/client/dconf-client.c Examining data/dconf-0.38.0/client/dconf-client.h Examining data/dconf-0.38.0/client/dconf.h Examining data/dconf-0.38.0/common/dconf-changeset.c Examining data/dconf-0.38.0/common/dconf-changeset.h Examining data/dconf-0.38.0/common/dconf-enums.h Examining data/dconf-0.38.0/common/dconf-error.c Examining data/dconf-0.38.0/common/dconf-paths.c Examining data/dconf-0.38.0/common/dconf-paths.h Examining data/dconf-0.38.0/engine/dconf-engine-mockable.c Examining data/dconf-0.38.0/engine/dconf-engine-mockable.h Examining data/dconf-0.38.0/engine/dconf-engine-profile.c Examining data/dconf-0.38.0/engine/dconf-engine-profile.h Examining data/dconf-0.38.0/engine/dconf-engine-source-file.c Examining data/dconf-0.38.0/engine/dconf-engine-source-private.h Examining data/dconf-0.38.0/engine/dconf-engine-source-service.c Examining data/dconf-0.38.0/engine/dconf-engine-source-system.c Examining data/dconf-0.38.0/engine/dconf-engine-source-user.c Examining data/dconf-0.38.0/engine/dconf-engine-source.c Examining data/dconf-0.38.0/engine/dconf-engine-source.h Examining data/dconf-0.38.0/engine/dconf-engine.c Examining data/dconf-0.38.0/engine/dconf-engine.h Examining data/dconf-0.38.0/gdbus/dconf-gdbus-common.c Examining data/dconf-0.38.0/gdbus/dconf-gdbus-filter.c Examining data/dconf-0.38.0/gdbus/dconf-gdbus-thread.c Examining data/dconf-0.38.0/gsettings/dconfsettingsbackend.c Examining data/dconf-0.38.0/gvdb/gvdb-builder.c Examining data/dconf-0.38.0/gvdb/gvdb-builder.h Examining data/dconf-0.38.0/gvdb/gvdb-format.h Examining data/dconf-0.38.0/gvdb/gvdb-reader.c Examining data/dconf-0.38.0/gvdb/gvdb-reader.h Examining data/dconf-0.38.0/service/dconf-blame.c Examining data/dconf-0.38.0/service/dconf-blame.h Examining data/dconf-0.38.0/service/dconf-gvdb-utils.c Examining data/dconf-0.38.0/service/dconf-gvdb-utils.h Examining data/dconf-0.38.0/service/dconf-keyfile-writer.c Examining data/dconf-0.38.0/service/dconf-service.c Examining data/dconf-0.38.0/service/dconf-service.h Examining data/dconf-0.38.0/service/dconf-shm-writer.c Examining data/dconf-0.38.0/service/dconf-writer.c Examining data/dconf-0.38.0/service/dconf-writer.h Examining data/dconf-0.38.0/service/main.c Examining data/dconf-0.38.0/shm/dconf-shm-mockable.c Examining data/dconf-0.38.0/shm/dconf-shm-mockable.h Examining data/dconf-0.38.0/shm/dconf-shm.c Examining data/dconf-0.38.0/shm/dconf-shm.h Examining data/dconf-0.38.0/tests/changeset.c Examining data/dconf-0.38.0/tests/client.c Examining data/dconf-0.38.0/tests/dbus-leak.c Examining data/dconf-0.38.0/tests/dbus.c Examining data/dconf-0.38.0/tests/dconf-mock-dbus.c Examining data/dconf-0.38.0/tests/dconf-mock-gvdb.c Examining data/dconf-0.38.0/tests/dconf-mock-shm.c Examining data/dconf-0.38.0/tests/dconf-mock.h Examining data/dconf-0.38.0/tests/engine.c Examining data/dconf-0.38.0/tests/gvdb.c Examining data/dconf-0.38.0/tests/paths.c Examining data/dconf-0.38.0/tests/shm.c Examining data/dconf-0.38.0/tests/tmpdir.c Examining data/dconf-0.38.0/tests/tmpdir.h Examining data/dconf-0.38.0/tests/writer.c FINAL RESULTS: data/dconf-0.38.0/tests/dbus.c:507:12: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. status = system ("gdbus emit --session " data/dconf-0.38.0/service/dconf-blame.c:152:7: [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 ("DCONF_BLAME")) data/dconf-0.38.0/bin/dconf.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 buffer[1024]; data/dconf-0.38.0/bin/dconf.c:853: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 (filename, O_WRONLY); data/dconf-0.38.0/engine/dconf-engine-mockable.c:38:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). return fopen (pathname, mode); data/dconf-0.38.0/engine/dconf-engine-profile.c:237: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 (path, MANDATORY_DIR, mdlen); data/dconf-0.38.0/engine/dconf-engine-profile.c:254: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 (path, runtime_dir, rdlen); data/dconf-0.38.0/engine/dconf-engine-profile.c:255: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 (path + rdlen, RUNTIME_PROFILE, sizeof RUNTIME_PROFILE); data/dconf-0.38.0/gvdb/gvdb-builder.c:295:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (chunk->data, string, length); data/dconf-0.38.0/gvdb/gvdb-builder.c:332: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 (chunk (sizeof bloom_hdr), &bloom_hdr, sizeof bloom_hdr); data/dconf-0.38.0/gvdb/gvdb-builder.c:333: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 (chunk (sizeof table_hdr), &table_hdr, sizeof table_hdr); data/dconf-0.38.0/gvdb/gvdb-reader.c:287:47: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. hash_value = (hash_value * 33) + ((signed char *) key)[key_length]; data/dconf-0.38.0/gvdb/gvdb-reader.c:445:19: [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 (fullname, parent_name, parent_length); data/dconf-0.38.0/gvdb/gvdb-reader.c:446:19: [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 (fullname + parent_length, name, name_length); data/dconf-0.38.0/service/dconf-blame.c:155: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/cmdline", O_RDONLY); data/dconf-0.38.0/service/dconf-keyfile-writer.c:201: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). kfw->lock_fd = open (kfw->lock_filename, O_RDWR | O_CREAT, 0666); data/dconf-0.38.0/service/dconf-keyfile-writer.c:213:22: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). kfw->lock_fd = open (kfw->lock_filename, O_RDWR | O_CREAT, 0666); data/dconf-0.38.0/service/dconf-writer.c:172: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). invalidate_fd = open (writer->priv->filename, O_WRONLY); data/dconf-0.38.0/shm/dconf-shm.c:68: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 (filename, O_RDWR | O_CREAT, 0600); data/dconf-0.38.0/shm/dconf-shm.c:118: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 (filename, O_RDWR); data/dconf-0.38.0/tests/engine.c:32:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). return fopen (filename, mode); data/dconf-0.38.0/tests/engine.c:1994: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 ((gpointer) message->fields[i].value, fields[i].value, length); data/dconf-0.38.0/tests/shm.c:29: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 (evil, O_WRONLY | O_CREAT, 0600); data/dconf-0.38.0/bin/dconf.c:439: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). n = strlen (dir_dst); data/dconf-0.38.0/bin/dconf.c:847: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). filename = strndup (dir, strlen (dir) - 2); data/dconf-0.38.0/common/dconf-changeset.c:487: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). prefix_length = strlen (key); data/dconf-0.38.0/common/dconf-changeset.c:758: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). prefix_len = strlen (changes->prefix); data/dconf-0.38.0/engine/dconf-engine-profile.c:235: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). gint mdlen = strlen (MANDATORY_DIR); data/dconf-0.38.0/engine/dconf-engine-profile.c:251: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). rdlen = strlen (runtime_dir); data/dconf-0.38.0/gvdb/gvdb-builder.c:288: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 (string); data/dconf-0.38.0/gvdb/gvdb-builder.c:390: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). basename = item->key + strlen (item->parent->key); data/dconf-0.38.0/gvdb/gvdb-reader.c:443: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). parent_length = strlen (parent_name); data/dconf-0.38.0/service/dconf-blame.c:161:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). s = read (fd, buffer, sizeof buffer - 1); data/dconf-0.38.0/service/dconf-gvdb-utils.c:148: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/dconf-0.38.0/service/dconf-keyfile-writer.c:348: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). group_to_remove = g_strndup (path + 1, strlen (path) - 2); data/dconf-0.38.0/service/dconf-service.c:109: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). path = object_path + strlen ("/ca/desrt/dconf"); data/dconf-0.38.0/tests/engine.c:1991: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). gsize length = (fields[i].length < 0) ? strlen (fields[i].value) + 1 : fields[i].length; data/dconf-0.38.0/tests/writer.c:193: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). g_assert_cmpuint (backup_file_contents_len, ==, strlen (data->corrupt_db_contents)); ANALYSIS SUMMARY: Hits = 38 Lines analyzed = 16243 in approximately 0.40 seconds (40118 lines/second) Physical Source Lines of Code (SLOC) = 10094 Hits@level = [0] 2 [1] 15 [2] 21 [3] 1 [4] 1 [5] 0 Hits@level+ = [0+] 40 [1+] 38 [2+] 23 [3+] 2 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 3.96275 [1+] 3.76461 [2+] 2.27858 [3+] 0.198138 [4+] 0.0990688 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.