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/libaccounts-glib-1.23/libaccounts-glib/accounts-glib.h
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-account-service.c
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-account-service.h
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-account.c
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-account.h
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-application.c
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-application.h
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-auth-data.c
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-auth-data.h
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-debug.c
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-debug.h
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-errors.h
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-internals.h
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-manager.c
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-manager.h
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-provider.c
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-provider.h
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-service-type.c
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-service-type.h
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-service.c
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-service.h
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-types.h
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-util.c
Examining data/libaccounts-glib-1.23/libaccounts-glib/ag-util.h
Examining data/libaccounts-glib-1.23/tests/check_ag.c
Examining data/libaccounts-glib-1.23/tests/test-process.c
Examining data/libaccounts-glib-1.23/tools/backup.c
Examining data/libaccounts-glib-1.23/tools/main.c

FINAL RESULTS:

data/libaccounts-glib-1.23/tests/check_ag.c:108:5:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    chmod (db_filename, S_IRUSR | S_IRGRP | S_IROTH);
data/libaccounts-glib-1.23/tests/check_ag.c:111:5:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    chmod (filename, S_IRUSR | S_IRGRP | S_IROTH);
data/libaccounts-glib-1.23/tests/check_ag.c:2921:11:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    ret = system ("test-process create myprovider MyAccountName");
data/libaccounts-glib-1.23/tests/check_ag.c:2959:11:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    ret = system (command);
data/libaccounts-glib-1.23/tests/check_ag.c:2971:11:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    ret = system ("test-process create2 myprovider MyAccountName");
data/libaccounts-glib-1.23/tests/check_ag.c:3058:11:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    ret = system (command);
data/libaccounts-glib-1.23/tests/check_ag.c:3248:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf (command, "test-process lock_db %d %s &",
data/libaccounts-glib-1.23/tests/check_ag.c:3250:11:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    ret = system (command);
data/libaccounts-glib-1.23/tests/check_ag.c:3679:11:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    ret = system (command);
data/libaccounts-glib-1.23/tests/check_ag.c:3693:11:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    ret = system (command);
data/libaccounts-glib-1.23/tests/check_ag.c:3992:11:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    ret = system ("test-process create3 myprovider MyAccountName");
data/libaccounts-glib-1.23/tests/check_ag.c:3996:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf (command, "test-process lock_db %d %s &",
data/libaccounts-glib-1.23/tests/check_ag.c:3998:11:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    ret = system (command);
data/libaccounts-glib-1.23/tests/test-process.c:359:19:  [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.
        basedir = g_get_home_dir ();
data/libaccounts-glib-1.23/libaccounts-glib/ag-account.c:1729: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 sql[512];
data/libaccounts-glib-1.23/libaccounts-glib/ag-manager.c:1330:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open (filename, O_RDWR);
data/libaccounts-glib-1.23/libaccounts-glib/ag-manager.c:1942: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 sql[512];
data/libaccounts-glib-1.23/libaccounts-glib/ag-manager.c:1968: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 sql[512];
data/libaccounts-glib-1.23/libaccounts-glib/ag-manager.c:2004: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 sql[512];
data/libaccounts-glib-1.23/tests/check_ag.c:2958:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf (command, "test-process delete %d", account_id);
data/libaccounts-glib-1.23/tests/check_ag.c:3057:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf (command, "test-process change %d", account_id);
data/libaccounts-glib-1.23/tests/check_ag.c:3244:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open (lock_filename, O_CREAT | O_RDWR, 0666);
data/libaccounts-glib-1.23/tests/check_ag.c:3678:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf (command, "test-process enabled_event %d", account->id);
data/libaccounts-glib-1.23/tests/check_ag.c:3692:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf (command, "test-process enabled_event2 %d", account->id);
data/libaccounts-glib-1.23/tests/check_ag.c:3981:10:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fd = open (lock_filename, O_CREAT | O_RDWR, 0666);
data/libaccounts-glib-1.23/tests/test-process.c:151:10:  [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).
    id = atoi(args->argv[0]);
data/libaccounts-glib-1.23/tests/test-process.c:288:10:  [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).
    id = atoi(args->argv[0]);
data/libaccounts-glib-1.23/tests/test-process.c:317:10:  [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).
    id = atoi(args->argv[0]);
data/libaccounts-glib-1.23/tests/test-process.c:332:10:  [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).
    id = atoi (args->argv[0]);
data/libaccounts-glib-1.23/tests/test-process.c:354:10:  [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).
    ms = atoi(args->argv[0]);
data/libaccounts-glib-1.23/tests/test-process.c:355: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).
    lock_file = open(args->argv[1], O_RDWR | O_APPEND);
data/libaccounts-glib-1.23/tools/main.c:216:48:  [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).
    account = ag_manager_get_account (manager, atoi (argv[2]));
data/libaccounts-glib-1.23/tools/main.c:323:48:  [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).
    account = ag_manager_get_account (manager, atoi (argv[2]));
data/libaccounts-glib-1.23/tools/main.c:411:48:  [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).
    account = ag_manager_get_account (manager, atoi (argv[2]));
data/libaccounts-glib-1.23/tools/main.c:525:38:  [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).
        g_value_set_boolean (gvalue, atoi (param[1]));
data/libaccounts-glib-1.23/tools/main.c:554:48:  [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).
    account = ag_manager_get_account (manager, atoi (argv[2]));
data/libaccounts-glib-1.23/tools/main.c:655:38:  [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).
        g_value_set_boolean (gvalue, atoi (param[1]));
data/libaccounts-glib-1.23/tools/main.c:682:48:  [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).
    account = ag_manager_get_account (manager, atoi (argv[2]));
data/libaccounts-glib-1.23/tools/main.c:785:48:  [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).
    account = ag_manager_get_account (manager, atoi (argv[2]));
data/libaccounts-glib-1.23/tools/main.c:844:56:  [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).
        list = g_list_prepend (list, GUINT_TO_POINTER (atoi (argv[2])));
data/libaccounts-glib-1.23/tools/main.c:929:52:  [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).
        account = ag_manager_get_account (manager, atoi (argv[2]));
data/libaccounts-glib-1.23/tools/main.c:1049:48:  [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).
    account = ag_manager_get_account (manager, atoi (argv[2]));
data/libaccounts-glib-1.23/tools/main.c:1086:48:  [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).
    account = ag_manager_get_account (manager, atoi (id));
data/libaccounts-glib-1.23/libaccounts-glib/ag-account.c:2278: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).
    prefix_length = ri->key_prefix ? strlen(ri->key_prefix) : 0;
data/libaccounts-glib-1.23/libaccounts-glib/ag-manager.c:332: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).
    suffix_length = strlen (suffix);
data/libaccounts-glib-1.23/libaccounts-glib/ag-manager.c:342: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).
        base_name = g_strndup (filename, (strlen (filename) - suffix_length));
data/libaccounts-glib-1.23/libaccounts-glib/ag-manager.c:1306:13:  [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(t * 1000);
data/libaccounts-glib-1.23/tests/check_ag.c:1324: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/libaccounts-glib-1.23/tests/check_ag.c:1335:10:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
    if (!equal)
data/libaccounts-glib-1.23/tests/check_ag.c:1340:18:  [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.
    fail_unless (equal);
data/libaccounts-glib-1.23/tests/check_ag.c:1441: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;

ANALYSIS SUMMARY:

Hits = 51
Lines analyzed = 16883 in approximately 0.53 seconds (31716 lines/second)
Physical Source Lines of Code (SLOC) = 11266
Hits@level = [0]  41 [1]   8 [2]  29 [3]   1 [4]  11 [5]   2
Hits@level+ = [0+]  92 [1+]  51 [2+]  43 [3+]  14 [4+]  13 [5+]   2
Hits/KSLOC@level+ = [0+] 8.16616 [1+] 4.5269 [2+] 3.81679 [3+] 1.24268 [4+] 1.15391 [5+] 0.177525
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.