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/policykit-1-0.118/test/polkitbackend/test-polkitbackendjsauthority.c
Examining data/policykit-1-0.118/test/polkit/polkitidentitytest.c
Examining data/policykit-1-0.118/test/polkit/polkitunixnetgrouptest.c
Examining data/policykit-1-0.118/test/polkit/polkitunixgrouptest.c
Examining data/policykit-1-0.118/test/polkit/polkitunixusertest.c
Examining data/policykit-1-0.118/test/mocklibc/src/pwd.c
Examining data/policykit-1-0.118/test/mocklibc/src/grp.c
Examining data/policykit-1-0.118/test/mocklibc/src/netdb.c
Examining data/policykit-1-0.118/test/mocklibc/src/netgroup-debug.h
Examining data/policykit-1-0.118/test/mocklibc/src/netgroup-debug.c
Examining data/policykit-1-0.118/test/mocklibc/src/netgroup.c
Examining data/policykit-1-0.118/test/mocklibc/src/netgroup.h
Examining data/policykit-1-0.118/test/polkittesthelper.h
Examining data/policykit-1-0.118/test/polkittesthelper.c
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendauthority.h
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendsessionmonitor.c
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendsessionmonitor.h
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendtypes.h
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendactionlookup.h
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendsessionmonitor-systemd.c
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendactionlookup.c
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackend.h
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendauthority.c
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendjsauthority.cpp
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendprivate.h
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendactionpool.h
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendinteractiveauthority.c
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendinteractiveauthority.h
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendjsauthority.h
Examining data/policykit-1-0.118/src/polkitbackend/polkitbackendactionpool.c
Examining data/policykit-1-0.118/src/polkitbackend/polkitd.c
Examining data/policykit-1-0.118/src/examples/frobnicate.c
Examining data/policykit-1-0.118/src/examples/cancel.c
Examining data/policykit-1-0.118/src/programs/pkexec.c
Examining data/policykit-1-0.118/src/programs/pkttyagent.c
Examining data/policykit-1-0.118/src/programs/pkcheck.c
Examining data/policykit-1-0.118/src/programs/pkaction.c
Examining data/policykit-1-0.118/src/polkit/polkitunixsession-systemd.c
Examining data/policykit-1-0.118/src/polkit/polkitauthority.c
Examining data/policykit-1-0.118/src/polkit/polkit.h
Examining data/policykit-1-0.118/src/polkit/polkitunixprocess.c
Examining data/policykit-1-0.118/src/polkit/polkitunixsession.c
Examining data/policykit-1-0.118/src/polkit/polkitunixuser.h
Examining data/policykit-1-0.118/src/polkit/polkitpermission.h
Examining data/policykit-1-0.118/src/polkit/polkitauthorityfeatures.c
Examining data/policykit-1-0.118/src/polkit/polkitidentity.c
Examining data/policykit-1-0.118/src/polkit/polkitprivate.h
Examining data/policykit-1-0.118/src/polkit/polkitunixsession.h
Examining data/policykit-1-0.118/src/polkit/polkitauthorityfeatures.h
Examining data/policykit-1-0.118/src/polkit/polkitcheckauthorizationflags.c
Examining data/policykit-1-0.118/src/polkit/polkitpermission.c
Examining data/policykit-1-0.118/src/polkit/polkitimplicitauthorization.c
Examining data/policykit-1-0.118/src/polkit/polkitactiondescription.c
Examining data/policykit-1-0.118/src/polkit/polkitunixnetgroup.h
Examining data/policykit-1-0.118/src/polkit/polkitunixnetgroup.c
Examining data/policykit-1-0.118/src/polkit/polkittemporaryauthorization.c
Examining data/policykit-1-0.118/src/polkit/polkitsubject.h
Examining data/policykit-1-0.118/src/polkit/polkiterror.h
Examining data/policykit-1-0.118/src/polkit/polkitsystembusname.c
Examining data/policykit-1-0.118/src/polkit/polkitactiondescription.h
Examining data/policykit-1-0.118/src/polkit/polkitunixuser.c
Examining data/policykit-1-0.118/src/polkit/polkitsystembusname.h
Examining data/policykit-1-0.118/src/polkit/polkitdetails.h
Examining data/policykit-1-0.118/src/polkit/polkitimplicitauthorization.h
Examining data/policykit-1-0.118/src/polkit/polkitauthority.h
Examining data/policykit-1-0.118/src/polkit/polkitcheckauthorizationflags.h
Examining data/policykit-1-0.118/src/polkit/polkittypes.h
Examining data/policykit-1-0.118/src/polkit/polkitunixgroup.h
Examining data/policykit-1-0.118/src/polkit/polkitauthorizationresult.h
Examining data/policykit-1-0.118/src/polkit/polkitunixprocess.h
Examining data/policykit-1-0.118/src/polkit/polkitidentity.h
Examining data/policykit-1-0.118/src/polkit/polkittemporaryauthorization.h
Examining data/policykit-1-0.118/src/polkit/polkiterror.c
Examining data/policykit-1-0.118/src/polkit/polkitdetails.c
Examining data/policykit-1-0.118/src/polkit/polkitunixgroup.c
Examining data/policykit-1-0.118/src/polkit/polkitauthorizationresult.c
Examining data/policykit-1-0.118/src/polkit/polkitsubject.c
Examining data/policykit-1-0.118/src/polkitagent/polkitagentsession.c
Examining data/policykit-1-0.118/src/polkitagent/polkitagenthelper-shadow.c
Examining data/policykit-1-0.118/src/polkitagent/polkitagentlistener.c
Examining data/policykit-1-0.118/src/polkitagent/polkitagenthelper-bsdauth.c
Examining data/policykit-1-0.118/src/polkitagent/polkitagent.h
Examining data/policykit-1-0.118/src/polkitagent/polkitagenthelperprivate.h
Examining data/policykit-1-0.118/src/polkitagent/polkitagenthelperprivate.c
Examining data/policykit-1-0.118/src/polkitagent/polkitagentlistener.h
Examining data/policykit-1-0.118/src/polkitagent/polkitagenttextlistener.c
Examining data/policykit-1-0.118/src/polkitagent/polkitagenthelper-pam.c
Examining data/policykit-1-0.118/src/polkitagent/polkitagenttextlistener.h
Examining data/policykit-1-0.118/src/polkitagent/polkitagentsession.h
Examining data/policykit-1-0.118/src/polkitagent/polkitagenttypes.h

FINAL RESULTS:

data/policykit-1-0.118/src/polkit/polkitsubject.c:250:16:  [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.
      else if (sscanf (str, "unix-process:%d:%" G_GUINT64_FORMAT, &scanned_pid, &scanned_starttime) == 2)
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-shadow.c:194:16:  [4] (crypto) crypt:
  The crypt functions use a poor one-way hashing algorithm; since they only
  accept passwords of 8 characters or fewer and only a two-byte salt, they
  are excessively vulnerable to dictionary attacks given today's faster
  computing equipment (CWE-327). Use a different algorithm, such as SHA-256,
  with a larger, non-repeating salt.
  crypt_pass = crypt (passwd, shadow->sp_pwdp);
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-shadow.c:199:32:  [4] (crypto) crypt:
  The crypt functions use a poor one-way hashing algorithm; since they only
  accept passwords of 8 characters or fewer and only a two-byte salt, they
  are excessively vulnerable to dictionary attacks given today's faster
  computing equipment (CWE-327). Use a different algorithm, such as SHA-256,
  with a larger, non-repeating salt.
  if (strcmp (shadow->sp_pwdp, crypt (passwd, shadow->sp_pwdp)) != 0)
data/policykit-1-0.118/src/programs/pkcheck.c:402: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.
          else if (sscanf (argv[n], "%i,%" G_GUINT64_FORMAT, &pid, &pid_start_time) == 2)
data/policykit-1-0.118/src/programs/pkexec.c:641:7:  [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 (path, F_OK) != 0)
data/policykit-1-0.118/src/programs/pkexec.c:1003: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.
  if (execv (path, exec_argv) != 0)
data/policykit-1-0.118/src/programs/pkttyagent.c:149: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 (opt_process, "%i,%" G_GUINT64_FORMAT, &pid, &pid_start_time)
data/policykit-1-0.118/src/polkitbackend/polkitbackendinteractiveauthority.c:1466:27:  [3] (random) g_rand_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.
                          g_rand_int (pool),
data/policykit-1-0.118/src/polkitbackend/polkitbackendinteractiveauthority.c:1467:27:  [3] (random) g_rand_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.
                          g_rand_int (pool),
data/policykit-1-0.118/src/polkitbackend/polkitbackendinteractiveauthority.c:1468:27:  [3] (random) g_rand_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.
                          g_rand_int (pool),
data/policykit-1-0.118/src/polkitbackend/polkitbackendinteractiveauthority.c:1469:27:  [3] (random) g_rand_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.
                          g_rand_int (pool));
data/policykit-1-0.118/src/programs/pkexec.c:690:16:  [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.
        home = g_get_home_dir ();
data/policykit-1-0.118/test/mocklibc/src/grp.c:34:22:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  const char *path = getenv(GROUP_CONFIG_KEY);
data/policykit-1-0.118/test/mocklibc/src/grp.c:60:22:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  const char *path = getenv(GROUP_CONFIG_KEY);
data/policykit-1-0.118/test/mocklibc/src/grp.c:81:22:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  const char *path = getenv(GROUP_CONFIG_KEY);
data/policykit-1-0.118/test/mocklibc/src/grp.c:102:22:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  const char *path = getenv(GROUP_CONFIG_KEY);
data/policykit-1-0.118/test/mocklibc/src/netgroup.c:108:22:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  const char *path = getenv(NETGROUP_CONFIG_KEY);
data/policykit-1-0.118/test/mocklibc/src/pwd.c:34:22:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  const char *path = getenv(PASSWD_CONFIG_KEY);
data/policykit-1-0.118/test/mocklibc/src/pwd.c:60:22:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  const char *path = getenv(PASSWD_CONFIG_KEY);
data/policykit-1-0.118/test/mocklibc/src/pwd.c:81:22:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  const char *path = getenv(PASSWD_CONFIG_KEY);
data/policykit-1-0.118/test/polkittesthelper.c:62: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.
  const gchar *root = getenv ("POLKIT_TEST_DATA");
data/policykit-1-0.118/src/polkit/polkitunixprocess.c:610: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 pname[32];
data/policykit-1-0.118/src/polkit/polkitunixprocess.c:614: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 ((procfd = open(pname, O_RDONLY)) == -1)
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-bsdauth.c:146: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 passwd[512];
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-pam.c:243: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[PAM_MAX_RESP_SIZE];
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-shadow.c:179: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 passwd[512], *crypt_pass;
data/policykit-1-0.118/src/polkitagent/polkitagenttextlistener.c:174:19:  [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).
  listener->tty = fopen (tty_name, "r+");
data/policykit-1-0.118/src/polkitagent/polkitagenttextlistener.c:348: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[2048];
data/policykit-1-0.118/src/polkitbackend/polkitbackendactionpool.c:1176:23:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      result = (const char *) g_hash_table_lookup (translations, (void *) langs[n]);
data/policykit-1-0.118/src/polkitbackend/polkitd.c:191: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).
      dev_null_fd = open ("/dev/null", O_RDWR);
data/policykit-1-0.118/src/programs/pkttyagent.c:257:11:  [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).
    tty = fopen(tty_name, "r+");
data/policykit-1-0.118/test/mocklibc/src/grp.c:38:19:  [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).
  global_stream = fopen(path, "r");
data/policykit-1-0.118/test/mocklibc/src/grp.c:64:18:  [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 *stream = fopen(path, "r");
data/policykit-1-0.118/test/mocklibc/src/grp.c:85:18:  [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 *stream = fopen(path, "r");
data/policykit-1-0.118/test/mocklibc/src/grp.c:108:18:  [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 *stream = fopen(path, "r");
data/policykit-1-0.118/test/mocklibc/src/netgroup.c:69: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(result, value, i);
data/policykit-1-0.118/test/mocklibc/src/netgroup.c:112:18:  [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 *stream = fopen(path, "r");
data/policykit-1-0.118/test/mocklibc/src/netgroup.c:249:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char ** triple [3] = {
data/policykit-1-0.118/test/mocklibc/src/netgroup.c:271:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(field, &value[start], len);
data/policykit-1-0.118/test/mocklibc/src/pwd.c:38:19:  [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).
  global_stream = fopen(path, "r");
data/policykit-1-0.118/test/mocklibc/src/pwd.c:64:18:  [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 *stream = fopen(path, "r");
data/policykit-1-0.118/test/mocklibc/src/pwd.c:85:18:  [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 *stream = fopen(path, "r");
data/policykit-1-0.118/test/polkit/polkitunixnetgrouptest.c:56: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(new_name_buf, "bar", 3);
data/policykit-1-0.118/src/polkit/polkitidentity.c:116:41:  [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.
  return POLKIT_IDENTITY_GET_IFACE (a)->equal (a, b);
data/policykit-1-0.118/src/polkit/polkitidentity.h:66: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)     (PolkitIdentity *a,
data/policykit-1-0.118/src/polkit/polkitsubject.c:119:40:  [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.
  return POLKIT_SUBJECT_GET_IFACE (a)->equal (a, b);
data/policykit-1-0.118/src/polkit/polkitsubject.h:69: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)         (PolkitSubject       *a,
data/policykit-1-0.118/src/polkit/polkitunixprocess.c:618:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read(procfd, ps, sizeof(struct psinfo)) < 0)
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-bsdauth.c:150:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
  usleep (10 * 1000); /* since fflush(3) seems buggy */
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-bsdauth.c:155: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 (passwd) > 0 && passwd[strlen (passwd) - 1] == '\n')
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-bsdauth.c:155:37:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (strlen (passwd) > 0 && passwd[strlen (passwd) - 1] == '\n')
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-bsdauth.c:156: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).
    passwd[strlen (passwd) - 1] = '\0';
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-pam.c:47: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).
  len2 = strlen(tmp2);
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-pam.c:271:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
          if (strlen (buf) > 0 &&
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-pam.c:272:19:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
              buf[strlen (buf) - 1] == '\n')
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-pam.c:273: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).
            buf[strlen (buf) - 1] = '\0';
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-pam.c:301: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).
        memset (aresp[i].resp, 0, strlen(aresp[i].resp));
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-shadow.c:183:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
  usleep (10 * 1000); /* since fflush(3) seems buggy */
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-shadow.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 (passwd) > 0 && passwd[strlen (passwd) - 1] == '\n')
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-shadow.c:188:37:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (strlen (passwd) > 0 && passwd[strlen (passwd) - 1] == '\n')
data/policykit-1-0.118/src/polkitagent/polkitagenthelper-shadow.c:189: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).
    passwd[strlen (passwd) - 1] = '\0';
data/policykit-1-0.118/src/polkitagent/polkitagenthelperprivate.c:144:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
  usleep (100 * 1000);
data/policykit-1-0.118/src/polkitagent/polkitagentsession.c:460: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 (line) > 0 && line[strlen (line) - 1] == '\n')
data/policykit-1-0.118/src/polkitagent/polkitagentsession.c:460:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (strlen (line) > 0 && line[strlen (line) - 1] == '\n')
data/policykit-1-0.118/src/polkitagent/polkitagentsession.c:461: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).
    line[strlen (line) - 1] = '\0';
data/policykit-1-0.118/src/polkitagent/polkitagentsession.c:541: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).
  response_len = strlen (response);
data/policykit-1-0.118/src/polkitagent/polkitagentsession.c:630:76:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  (void) g_output_stream_write_all (session->child_stdin, session->cookie, strlen (session->cookie),
data/policykit-1-0.118/src/polkitagent/polkitagenttextlistener.c:280:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = getc (listener->tty);
data/policykit-1-0.118/src/polkitagent/polkitagenttextlistener.c:362: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 (ppw->pw_gecos == NULL || strlen (ppw->pw_gecos) == 0 || strcmp (ppw->pw_gecos, ppw->pw_name) == 0)
data/policykit-1-0.118/src/polkitagent/polkitagenttextlistener.c:408:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      c = getc (listener->tty);
data/policykit-1-0.118/src/polkitbackend/polkitbackendactionpool.c:840: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 (icon_name);
data/policykit-1-0.118/src/polkitbackend/polkitbackendactionpool.c:1095: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).
  xml_res = XML_Parse (pd.parser, xml, strlen (xml), 1);
data/policykit-1-0.118/src/polkitbackend/polkitbackendauthority.c:764: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 (cancellation_id) > 0)
data/policykit-1-0.118/src/polkitbackend/polkitbackendinteractiveauthority.c:2909: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).
  if (name[0] == ':' && strlen (new_owner) == 0)
data/policykit-1-0.118/src/polkitbackend/polkitbackendjsauthority.cpp:529: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 (!source.init (authority->priv->cx, init_js, strlen (init_js),
data/policykit-1-0.118/src/polkitbackend/polkitbackendjsauthority.cpp:684: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).
      JS::ConstUTF8CharsZ chars(value, strlen(value));
data/policykit-1-0.118/src/polkitbackend/polkitbackendjsauthority.cpp:712: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).
          JS::ConstUTF8CharsZ chars(c_string, strlen(c_string));
data/policykit-1-0.118/src/polkitbackend/polkitbackendjsauthority.cpp:777:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (!source.init (authority->priv->cx, src, strlen (src),
data/policykit-1-0.118/src/polkitbackend/polkitbackendjsauthority.cpp:904:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (!source.init (authority->priv->cx, src, strlen (src),
data/policykit-1-0.118/src/programs/pkexec.c:320:47:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
          if (allow_gui_annotation != NULL && strlen (allow_gui_annotation) > 0)
data/policykit-1-0.118/src/programs/pkexec.c:773: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 (pw->pw_gecos != NULL && strlen (pw->pw_gecos) > 0)
data/policykit-1-0.118/test/polkit/polkitidentitytest.c:31:12:  [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/policykit-1-0.118/test/polkit/polkitidentitytest.c:121:13:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
  if (data->equal)

ANALYSIS SUMMARY:

Hits = 83
Lines analyzed = 28324 in approximately 0.65 seconds (43768 lines/second)
Physical Source Lines of Code (SLOC) = 18907
Hits@level = [0]  98 [1]  40 [2]  22 [3]  14 [4]   7 [5]   0
Hits@level+ = [0+] 181 [1+]  83 [2+]  43 [3+]  21 [4+]   7 [5+]   0
Hits/KSLOC@level+ = [0+] 9.57317 [1+] 4.38991 [2+] 2.27429 [3+] 1.1107 [4+] 0.370233 [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.