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/chrony-4.0/addressing.h
Examining data/chrony-4.0/addrfilt.c
Examining data/chrony-4.0/addrfilt.h
Examining data/chrony-4.0/array.c
Examining data/chrony-4.0/array.h
Examining data/chrony-4.0/candm.h
Examining data/chrony-4.0/client.c
Examining data/chrony-4.0/clientlog.c
Examining data/chrony-4.0/clientlog.h
Examining data/chrony-4.0/cmac.h
Examining data/chrony-4.0/cmac_nettle.c
Examining data/chrony-4.0/cmdmon.c
Examining data/chrony-4.0/cmdmon.h
Examining data/chrony-4.0/cmdparse.c
Examining data/chrony-4.0/cmdparse.h
Examining data/chrony-4.0/conf.c
Examining data/chrony-4.0/conf.h
Examining data/chrony-4.0/getdate.h
Examining data/chrony-4.0/hash.h
Examining data/chrony-4.0/hash_intmd5.c
Examining data/chrony-4.0/hash_nettle.c
Examining data/chrony-4.0/hash_nss.c
Examining data/chrony-4.0/hash_tomcrypt.c
Examining data/chrony-4.0/hwclock.c
Examining data/chrony-4.0/hwclock.h
Examining data/chrony-4.0/keys.c
Examining data/chrony-4.0/keys.h
Examining data/chrony-4.0/local.c
Examining data/chrony-4.0/local.h
Examining data/chrony-4.0/localp.h
Examining data/chrony-4.0/logging.c
Examining data/chrony-4.0/logging.h
Examining data/chrony-4.0/main.c
Examining data/chrony-4.0/main.h
Examining data/chrony-4.0/manual.c
Examining data/chrony-4.0/manual.h
Examining data/chrony-4.0/md5.c
Examining data/chrony-4.0/md5.h
Examining data/chrony-4.0/memory.c
Examining data/chrony-4.0/memory.h
Examining data/chrony-4.0/nameserv.c
Examining data/chrony-4.0/nameserv.h
Examining data/chrony-4.0/nameserv_async.c
Examining data/chrony-4.0/nameserv_async.h
Examining data/chrony-4.0/ntp.h
Examining data/chrony-4.0/ntp_auth.c
Examining data/chrony-4.0/ntp_auth.h
Examining data/chrony-4.0/ntp_core.c
Examining data/chrony-4.0/ntp_core.h
Examining data/chrony-4.0/ntp_ext.c
Examining data/chrony-4.0/ntp_ext.h
Examining data/chrony-4.0/ntp_io.c
Examining data/chrony-4.0/ntp_io.h
Examining data/chrony-4.0/ntp_io_linux.c
Examining data/chrony-4.0/ntp_io_linux.h
Examining data/chrony-4.0/ntp_signd.c
Examining data/chrony-4.0/ntp_signd.h
Examining data/chrony-4.0/ntp_sources.c
Examining data/chrony-4.0/ntp_sources.h
Examining data/chrony-4.0/nts_ke.h
Examining data/chrony-4.0/nts_ke_client.c
Examining data/chrony-4.0/nts_ke_client.h
Examining data/chrony-4.0/nts_ke_server.c
Examining data/chrony-4.0/nts_ke_server.h
Examining data/chrony-4.0/nts_ke_session.c
Examining data/chrony-4.0/nts_ke_session.h
Examining data/chrony-4.0/nts_ntp.h
Examining data/chrony-4.0/nts_ntp_auth.c
Examining data/chrony-4.0/nts_ntp_auth.h
Examining data/chrony-4.0/nts_ntp_client.c
Examining data/chrony-4.0/nts_ntp_client.h
Examining data/chrony-4.0/nts_ntp_server.c
Examining data/chrony-4.0/nts_ntp_server.h
Examining data/chrony-4.0/pktlength.c
Examining data/chrony-4.0/pktlength.h
Examining data/chrony-4.0/privops.c
Examining data/chrony-4.0/privops.h
Examining data/chrony-4.0/refclock.c
Examining data/chrony-4.0/refclock.h
Examining data/chrony-4.0/refclock_phc.c
Examining data/chrony-4.0/refclock_pps.c
Examining data/chrony-4.0/refclock_shm.c
Examining data/chrony-4.0/refclock_sock.c
Examining data/chrony-4.0/reference.c
Examining data/chrony-4.0/reference.h
Examining data/chrony-4.0/regress.c
Examining data/chrony-4.0/regress.h
Examining data/chrony-4.0/reports.h
Examining data/chrony-4.0/rtc.c
Examining data/chrony-4.0/rtc.h
Examining data/chrony-4.0/rtc_linux.c
Examining data/chrony-4.0/rtc_linux.h
Examining data/chrony-4.0/samplefilt.c
Examining data/chrony-4.0/samplefilt.h
Examining data/chrony-4.0/sched.c
Examining data/chrony-4.0/sched.h
Examining data/chrony-4.0/siv.h
Examining data/chrony-4.0/siv_gnutls.c
Examining data/chrony-4.0/siv_nettle.c
Examining data/chrony-4.0/siv_nettle_int.c
Examining data/chrony-4.0/smooth.c
Examining data/chrony-4.0/smooth.h
Examining data/chrony-4.0/socket.c
Examining data/chrony-4.0/socket.h
Examining data/chrony-4.0/sources.c
Examining data/chrony-4.0/sources.h
Examining data/chrony-4.0/sourcestats.c
Examining data/chrony-4.0/sourcestats.h
Examining data/chrony-4.0/srcparams.h
Examining data/chrony-4.0/stubs.c
Examining data/chrony-4.0/sys.c
Examining data/chrony-4.0/sys.h
Examining data/chrony-4.0/sys_generic.c
Examining data/chrony-4.0/sys_generic.h
Examining data/chrony-4.0/sys_linux.c
Examining data/chrony-4.0/sys_linux.h
Examining data/chrony-4.0/sys_macosx.c
Examining data/chrony-4.0/sys_macosx.h
Examining data/chrony-4.0/sys_netbsd.c
Examining data/chrony-4.0/sys_netbsd.h
Examining data/chrony-4.0/sys_null.c
Examining data/chrony-4.0/sys_null.h
Examining data/chrony-4.0/sys_posix.c
Examining data/chrony-4.0/sys_posix.h
Examining data/chrony-4.0/sys_solaris.c
Examining data/chrony-4.0/sys_solaris.h
Examining data/chrony-4.0/sys_timex.c
Examining data/chrony-4.0/sys_timex.h
Examining data/chrony-4.0/sysincl.h
Examining data/chrony-4.0/tempcomp.c
Examining data/chrony-4.0/tempcomp.h
Examining data/chrony-4.0/test/kernel/adjtime.c
Examining data/chrony-4.0/test/kernel/ntpadjtime.c
Examining data/chrony-4.0/test/unit/addrfilt.c
Examining data/chrony-4.0/test/unit/clientlog.c
Examining data/chrony-4.0/test/unit/cmac.c
Examining data/chrony-4.0/test/unit/hash.c
Examining data/chrony-4.0/test/unit/hwclock.c
Examining data/chrony-4.0/test/unit/keys.c
Examining data/chrony-4.0/test/unit/ntp_auth.c
Examining data/chrony-4.0/test/unit/ntp_core.c
Examining data/chrony-4.0/test/unit/ntp_ext.c
Examining data/chrony-4.0/test/unit/ntp_sources.c
Examining data/chrony-4.0/test/unit/nts_ke_client.c
Examining data/chrony-4.0/test/unit/nts_ke_server.c
Examining data/chrony-4.0/test/unit/nts_ke_session.c
Examining data/chrony-4.0/test/unit/nts_ntp_auth.c
Examining data/chrony-4.0/test/unit/nts_ntp_client.c
Examining data/chrony-4.0/test/unit/nts_ntp_server.c
Examining data/chrony-4.0/test/unit/regress.c
Examining data/chrony-4.0/test/unit/samplefilt.c
Examining data/chrony-4.0/test/unit/siv.c
Examining data/chrony-4.0/test/unit/smooth.c
Examining data/chrony-4.0/test/unit/sources.c
Examining data/chrony-4.0/test/unit/test.c
Examining data/chrony-4.0/test/unit/test.h
Examining data/chrony-4.0/test/unit/util.c
Examining data/chrony-4.0/util.c
Examining data/chrony-4.0/util.h
Examining data/chrony-4.0/getdate.c

FINAL RESULTS:

data/chrony-4.0/socket.c:518:43:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
  if (flags & SCK_FLAG_ALL_PERMISSIONS && chmod(addr, 0666) < 0) {
data/chrony-4.0/sys_linux.c:532:14:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    SCMP_SYS(chmod),
data/chrony-4.0/sys_linux.c:533:14:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
    SCMP_SYS(chown),
data/chrony-4.0/sys_linux.c:546:14:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
    SCMP_SYS(readlink),
data/chrony-4.0/util.c:1084: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(p, uid, gid) < 0) {
data/chrony-4.0/client.c:92:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vfprintf(stderr, format, ap);
data/chrony-4.0/client.c:1240:5:  [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.
    printf(line % 2 == 0 ? (len >= 28 ? "%s\n%28s" : "%-28s%s") : "%s%s\n",
data/chrony-4.0/client.c:1970:9:  [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.
        printf(sign ? "%+*.*f" : "%*.*f", width, prec, dbl);
data/chrony-4.0/client.c:2011:3:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vprintf(format, ap);
data/chrony-4.0/client.c:2748: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(arg, "%"SCNu32, &min_hits) != 1) {
data/chrony-4.0/client.c:3423:7:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
      strcat(line, argv[i]);
data/chrony-4.0/client.c:3426:9:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(line, argv[i]);
data/chrony-4.0/cmdparse.c:284:7:  [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(s1, "%"SCNu32, id) != 1)
data/chrony-4.0/getdate.c:875:21:  [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 YYFPRINTF fprintf
data/chrony-4.0/logging.c:123:5:  [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(priority, fatal ? "Fatal error : %s" : "%s", message);
data/chrony-4.0/logging.c:125:5:  [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.
    fprintf(file_log, fatal ? "Fatal error : %s\n" : "%s\n", message);
data/chrony-4.0/logging.c:159: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(buf, sizeof(buf), format, other_args);
data/chrony-4.0/logging.c:330:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
  vfprintf(logfiles[id].file, format, other_args);
data/chrony-4.0/logging.h:39:69:  [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.
#define FORMAT_ATTRIBUTE_PRINTF(str, first) __attribute__ ((format (printf, str, first)))
data/chrony-4.0/nts_ke_server.c:588:9:  [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.
        sscanf(words[0], "%"PRIX32, &id) != 1)
data/chrony-4.0/privops.c:151: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(res->data.fatal_msg.msg, sizeof (res->data.fatal_msg.msg), fmt, ap);
data/chrony-4.0/reference.c:500:9:  [4] (shell) popen:
  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.
    p = popen(buffer, "w");
data/chrony-4.0/reference.c:624:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy(tz_orig, tz_env);
data/chrony-4.0/sources.c:1336:5:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    snprintf(filename, sizeof (filename), "refid:%08"PRIx32, inst->ref_id);
data/chrony-4.0/sourcestats.c:872:5:  [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.
    fprintf(out,
data/chrony-4.0/sourcestats.c:919:12:  [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.
          (sscanf(line,
data/chrony-4.0/sys.c:72:16:  [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.
#error Unknown system
data/chrony-4.0/sys.c:94:16:  [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.
#error Unknown system
data/chrony-4.0/sys_linux.c:531:14:  [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.
    SCMP_SYS(access),
data/chrony-4.0/util.c:315:7:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
      snprintf(result, BUFFER_LENGTH, "ID#%010"PRIu32, addr->addr.id);
data/chrony-4.0/util.c:366:7:  [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(addr, "ID#%"SCNu32, &ip->addr.id) == 1) {
data/chrony-4.0/util.c:544:3:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  snprintf(result, BUFFER_LENGTH,
data/chrony-4.0/client.c:3519:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while ((opt = getopt(argc, argv, "+46acdf:h:mnNp:v")) != -1) {
data/chrony-4.0/main.c:460:17:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while ((opt = getopt(argc, argv, "46df:F:hl:L:mnpP:qQrRst:u:Uvx")) != -1) {
data/chrony-4.0/reference.c:620: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.
  tz_env = getenv("TZ");
data/chrony-4.0/test/unit/addrfilt.c:47:13:  [3] (random) random:
  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.
      sub = random() % (maxsub + 1);
data/chrony-4.0/test/unit/clientlog.c:53:25:  [3] (random) random:
  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.
    ts.tv_sec = (time_t)random() & 0x0fffffff;
data/chrony-4.0/test/unit/clientlog.c:60:11:  [3] (random) random:
  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.
      s = random() % MAX_SERVICES;
data/chrony-4.0/test/unit/clientlog.c:65:42:  [3] (random) random:
  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.
      UTI_AddDoubleToTimespec(&ts, (1 << random() % 14) / 100.0, &ts);
data/chrony-4.0/test/unit/hash.c:116:41:  [3] (random) random:
  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.
      length = HSH_Hash(hash_id, data1, random() % sizeof (data1),
data/chrony-4.0/test/unit/hash.c:117:25:  [3] (random) random:
  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.
                        random() % 2 ? data2 : NULL, random() % sizeof (data2),
data/chrony-4.0/test/unit/hash.c:117:54:  [3] (random) random:
  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.
                        random() % 2 ? data2 : NULL, random() % sizeof (data2),
data/chrony-4.0/test/unit/hwclock.c:35:32:  [3] (random) random:
  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.
    clock = HCL_CreateInstance(random() % (1 << i), 1 << i, 1.0);
data/chrony-4.0/test/unit/keys.c:39:12:  [3] (random) random:
  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.
  length = random() % sizeof (key) + 1;
data/chrony-4.0/test/unit/keys.c:41:12:  [3] (random) random:
  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.
  prefix = random() % 2 ? "HEX:" : "";
data/chrony-4.0/test/unit/keys.c:43:11:  [3] (random) random:
  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.
  switch (random() % 8) {
data/chrony-4.0/test/unit/keys.c:130:18:  [3] (random) random:
  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.
      data_len = random() % (sizeof (data) + 1);
data/chrony-4.0/test/unit/keys.c:139:18:  [3] (random) random:
  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.
      auth_len = random() % auth_len + 1;
data/chrony-4.0/test/unit/ntp_auth.c:47:14:  [3] (random) random:
  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.
      mode = random() % 2 ? (req ? MODE_CLIENT : MODE_SERVER) :
data/chrony-4.0/test/unit/ntp_auth.c:55:21:  [3] (random) random:
  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.
      version = 3 + random() % 2;
data/chrony-4.0/test/unit/ntp_auth.c:56:14:  [3] (random) random:
  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.
      mode = random() % 2 ? (req ? MODE_CLIENT : MODE_SERVER) :
data/chrony-4.0/test/unit/ntp_auth.c:70:14:  [3] (random) random:
  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.
    for (i = random() % 5; i > 0; i--)
data/chrony-4.0/test/unit/ntp_auth.c:91:22:  [3] (random) random:
  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.
          len = 16 + random() % 2 * 4;
data/chrony-4.0/test/unit/ntp_auth.c:92:22:  [3] (random) random:
  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.
          fill = 1 + random() % 255;
data/chrony-4.0/test/unit/ntp_auth.c:170:18:  [3] (random) random:
  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.
        key_id = random() % 7 + 2;
data/chrony-4.0/test/unit/ntp_auth.c:188:22:  [3] (random) random:
  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.
        key_id = 1 + random() % 100;
data/chrony-4.0/test/unit/ntp_auth.c:195:22:  [3] (random) random:
  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.
        key_id = 1 + random() % 100;
data/chrony-4.0/test/unit/ntp_auth.c:217:11:  [3] (random) random:
  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.
      if (random() % 2)
data/chrony-4.0/test/unit/ntp_auth.c:222:18:  [3] (random) random:
  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.
        for (j = random() % 5; j > 0; j--)
data/chrony-4.0/test/unit/ntp_core.c:51:37:  [3] (random) random:
  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.
#define LCL_GetSysPrecisionAsLog() (random() % 10 - 30)
data/chrony-4.0/test/unit/ntp_core.c:76:10:  [3] (random) random:
  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.
    id = random() % 8 + 2;
data/chrony-4.0/test/unit/ntp_core.c:97:7:  [3] (random) random:
  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.
  if (random() % 2) {
data/chrony-4.0/test/unit/ntp_core.c:130:7:  [3] (random) random:
  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.
  if (random() % 2) {
data/chrony-4.0/test/unit/ntp_core.c:167:13:  [3] (random) random:
  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.
    switch (random() % (allow_update ? 4 : 5)) {
data/chrony-4.0/test/unit/ntp_core.c:169:32:  [3] (random) random:
  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.
        res->originate_ts.hi = random();
data/chrony-4.0/test/unit/ntp_core.c:172:32:  [3] (random) random:
  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.
        res->originate_ts.lo = random();
data/chrony-4.0/test/unit/ntp_core.c:190:44:  [3] (random) random:
  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.
  if (NTP_LVM_TO_VERSION(res->lvm) == 4 && random() % 2) {
data/chrony-4.0/test/unit/ntp_core.c:194:11:  [3] (random) random:
  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.
    efs = random() % 5;
data/chrony-4.0/test/unit/ntp_core.c:198:21:  [3] (random) random:
  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.
               4 * (random() % 10);
data/chrony-4.0/test/unit/ntp_core.c:223:13:  [3] (random) random:
  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.
    switch (random() % 5) {
data/chrony-4.0/test/unit/ntp_core.c:234:56:  [3] (random) random:
  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.
        ((unsigned char *)res)[res_length - auth_len + random() % auth_len]++;
data/chrony-4.0/test/unit/ntp_core.c:238:25:  [3] (random) random:
  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.
        auth_len = 4 * (random() % (auth_len / 4));
data/chrony-4.0/test/unit/ntp_core.c:242:50:  [3] (random) random:
  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.
        if (NTP_LVM_TO_VERSION(res->lvm) == 4 && random() % 2 &&
data/chrony-4.0/test/unit/ntp_core.c:245:32:  [3] (random) random:
  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.
          auth_len += 4 + 4 * (random() %
data/chrony-4.0/test/unit/ntp_core.c:328:31:  [3] (random) random:
  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.
    res_buffer = packet_queue[random() % queue_length];
data/chrony-4.0/test/unit/ntp_core.c:373:33:  [3] (random) random:
  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.
    source.params.interleaved = random() % 2;
data/chrony-4.0/test/unit/ntp_core.c:374:29:  [3] (random) random:
  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.
    source.params.authkey = random() % 2 ? get_random_key_id() : INACTIVE_AUTHKEY;
data/chrony-4.0/test/unit/ntp_core.c:375:29:  [3] (random) random:
  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.
    source.params.version = random() % 4 + 1;
data/chrony-4.0/test/unit/ntp_core.c:383:46:  [3] (random) random:
  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.
    inst1 = NCR_CreateInstance(&remote_addr, random() % 2 ? NTP_SERVER : NTP_PEER,
data/chrony-4.0/test/unit/ntp_core.c:391:21:  [3] (random) random:
  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.
      interleaved = random() % 2 && (inst1->mode != MODE_CLIENT ||
data/chrony-4.0/test/unit/ntp_core.c:393:23:  [3] (random) random:
  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.
      authenticated = random() % 2;
data/chrony-4.0/test/unit/ntp_core.c:439:46:  [3] (random) random:
  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.
    inst1 = NCR_CreateInstance(&remote_addr, random() % 2 ? NTP_SERVER : NTP_PEER,
data/chrony-4.0/test/unit/ntp_ext.c:46:19:  [3] (random) random:
  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.
    body_length = random() % (sizeof (body) - 4 + 1) / 4 * 4;
data/chrony-4.0/test/unit/ntp_ext.c:47:13:  [3] (random) random:
  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.
    start = random() % (sizeof (packet.extensions) - body_length - 4 + 1) / 4 * 4;
data/chrony-4.0/test/unit/ntp_ext.c:48:12:  [3] (random) random:
  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.
    type = random() % 0x10000;
data/chrony-4.0/test/unit/ntp_sources.c:61:23:  [3] (random) random:
  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.
      addrs[j].port = random() % 1024;
data/chrony-4.0/test/unit/ntp_sources.c:69:32:  [3] (random) random:
  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.
      NSR_AddSource(&addrs[j], random() % 2 ? NTP_SERVER : NTP_PEER, &params, NULL);
data/chrony-4.0/test/unit/nts_ke_client.c:38:13:  [3] (random) random:
  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.
    index = random() % 10;
data/chrony-4.0/test/unit/nts_ke_client.c:48:21:  [3] (random) random:
  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.
    data[0] = htons(random() % 100);
data/chrony-4.0/test/unit/nts_ke_client.c:49:43:  [3] (random) random:
  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.
    TEST_CHECK(NKSN_AddRecord(session, 1, random() % 2 ? NKE_RECORD_ERROR : NKE_RECORD_WARNING,
data/chrony-4.0/test/unit/nts_ke_client.c:57:49:  [3] (random) random:
  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.
      data[0] = htons(NKE_NEXT_PROTOCOL_NTPV4 + random() % 10 + 1);
data/chrony-4.0/test/unit/nts_ke_client.c:61:20:  [3] (random) random:
  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.
      length = 3 + random() % 10;
data/chrony-4.0/test/unit/nts_ke_client.c:67:47:  [3] (random) random:
  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.
      data[0] = htons(AEAD_AES_SIV_CMAC_256 + random() % 10 + 1);
data/chrony-4.0/test/unit/nts_ke_client.c:71:20:  [3] (random) random:
  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.
      length = 3 + random() % 10;
data/chrony-4.0/test/unit/nts_ke_client.c:75:7:  [3] (random) random:
  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.
  if (random() % 2) {
data/chrony-4.0/test/unit/nts_ke_client.c:81:7:  [3] (random) random:
  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.
  if (random() % 2) {
data/chrony-4.0/test/unit/nts_ke_client.c:86:7:  [3] (random) random:
  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.
  if (random() % 2) {
data/chrony-4.0/test/unit/nts_ke_client.c:87:14:  [3] (random) random:
  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.
    length = random() % (sizeof (data) + 1);
data/chrony-4.0/test/unit/nts_ke_client.c:88:50:  [3] (random) random:
  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.
    TEST_CHECK(NKSN_AddRecord(session, 0, 1000 + random() % 1000, data, length));
data/chrony-4.0/test/unit/nts_ke_client.c:93:17:  [3] (random) random:
  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.
      length = (random() % sizeof (data) + 1) / 4 * 4;
data/chrony-4.0/test/unit/nts_ke_client.c:95:56:  [3] (random) random:
  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.
        length += (length < sizeof (data) ? 1 : -1) * (random() % 3 + 1);
data/chrony-4.0/test/unit/nts_ke_client.c:127:13:  [3] (random) random:
  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.
    valid = random() % 2;
data/chrony-4.0/test/unit/nts_ke_server.c:53:13:  [3] (random) random:
  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.
    index = random() % 9;
data/chrony-4.0/test/unit/nts_ke_server.c:68:20:  [3] (random) random:
  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.
      length = 3 + random() % 15 * 2;
data/chrony-4.0/test/unit/nts_ke_server.c:70:20:  [3] (random) random:
  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.
      length = 2 + random() % 16 * 2;
data/chrony-4.0/test/unit/nts_ke_server.c:82:20:  [3] (random) random:
  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.
      length = 3 + random() % 15 * 2;
data/chrony-4.0/test/unit/nts_ke_server.c:84:20:  [3] (random) random:
  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.
      length = 2 + random() % 16 * 2;
data/chrony-4.0/test/unit/nts_ke_server.c:92:14:  [3] (random) random:
  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.
    length = random() % (sizeof (data) + 1);
data/chrony-4.0/test/unit/nts_ke_server.c:93:50:  [3] (random) random:
  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.
    TEST_CHECK(NKSN_AddRecord(session, 1, 1000 + random() % 1000, data, length));
data/chrony-4.0/test/unit/nts_ke_server.c:96:7:  [3] (random) random:
  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.
  if (random() % 2) {
data/chrony-4.0/test/unit/nts_ke_server.c:102:7:  [3] (random) random:
  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.
  if (random() % 2) {
data/chrony-4.0/test/unit/nts_ke_server.c:107:7:  [3] (random) random:
  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.
  if (random() % 2) {
data/chrony-4.0/test/unit/nts_ke_server.c:108:14:  [3] (random) random:
  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.
    length = random() % (sizeof (data) + 1);
data/chrony-4.0/test/unit/nts_ke_server.c:109:50:  [3] (random) random:
  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.
    TEST_CHECK(NKSN_AddRecord(session, 0, 1000 + random() % 1000, data, length));
data/chrony-4.0/test/unit/nts_ke_server.c:167:13:  [3] (random) random:
  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.
    valid = random() % 2;
data/chrony-4.0/test/unit/nts_ke_server.c:186:9:  [3] (random) random:
  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.
    if (random() % 4) {
data/chrony-4.0/test/unit/nts_ke_server.c:187:21:  [3] (random) random:
  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.
      cookie.cookie[random() % (cookie.length)]++;
data/chrony-4.0/test/unit/nts_ke_server.c:188:16:  [3] (random) random:
  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.
    } else if (random() % 4) {
data/chrony-4.0/test/unit/nts_ke_server.c:193:25:  [3] (random) random:
  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.
        cookie.length = random() % (sizeof (cookie.cookie) + 1);
data/chrony-4.0/test/unit/nts_ke_session.c:43:19:  [3] (random) random:
  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.
  record_length = random() % (NKE_MAX_MESSAGE_LENGTH - 4 + 1);
data/chrony-4.0/test/unit/nts_ke_session.c:45:17:  [3] (random) random:
  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.
    record[i] = random() % 256;
data/chrony-4.0/test/unit/nts_ke_session.c:46:14:  [3] (random) random:
  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.
  critical = random() % 2;
data/chrony-4.0/test/unit/nts_ke_session.c:47:16:  [3] (random) random:
  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.
  type_start = random() % 30000 + 1;
data/chrony-4.0/test/unit/nts_ke_session.c:49:13:  [3] (random) random:
  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.
  records = random() % ((NKE_MAX_MESSAGE_LENGTH - 4) / (4 + record_length) + 1);
data/chrony-4.0/test/unit/nts_ke_session.c:88:21:  [3] (random) random:
  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.
    buffer_length = random() % (record_length + 1);
data/chrony-4.0/test/unit/nts_ntp_auth.c:47:16:  [3] (random) random:
  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.
      key[j] = random() % 256;
data/chrony-4.0/test/unit/nts_ntp_auth.c:50:20:  [3] (random) random:
  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.
    nonce_length = random() % sizeof (nonce) + 1;
data/chrony-4.0/test/unit/nts_ntp_auth.c:52:18:  [3] (random) random:
  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.
      nonce[j] = random() % 256;
data/chrony-4.0/test/unit/nts_ntp_auth.c:54:24:  [3] (random) random:
  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.
    plaintext_length = random() % (sizeof (plaintext) + 1);
data/chrony-4.0/test/unit/nts_ntp_auth.c:56:22:  [3] (random) random:
  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.
      plaintext[j] = random() % 256;
data/chrony-4.0/test/unit/nts_ntp_auth.c:58:41:  [3] (random) random:
  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.
    packet_length = NTP_HEADER_LENGTH + random() % 100 * 4;
data/chrony-4.0/test/unit/nts_ntp_auth.c:59:21:  [3] (random) random:
  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.
    min_ef_length = random() % (sizeof (packet) - packet_length);
data/chrony-4.0/test/unit/nts_ntp_auth.c:95:9:  [3] (random) random:
  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.
    j = random() % (packet_length + plaintext_length +
data/chrony-4.0/test/unit/nts_ntp_client.c:32:26:  [3] (random) random:
  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.
#define NKC_Start(inst) (random() % 2)
data/chrony-4.0/test/unit/nts_ntp_client.c:33:29:  [3] (random) random:
  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.
#define NKC_IsActive(inst) (random() % 2)
data/chrony-4.0/test/unit/nts_ntp_client.c:50:7:  [3] (random) random:
  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.
  if (random() % 2)
data/chrony-4.0/test/unit/nts_ntp_client.c:60:18:  [3] (random) random:
  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.
  *num_cookies = random() % max_cookies + 1;
data/chrony-4.0/test/unit/nts_ntp_client.c:62:25:  [3] (random) random:
  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.
    cookies[i].length = random() % (sizeof (cookies[i].cookie) + 1);
data/chrony-4.0/test/unit/nts_ntp_client.c:63:9:  [3] (random) random:
  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.
    if (random() % 4 != 0)
data/chrony-4.0/test/unit/nts_ntp_client.c:65:31:  [3] (random) random:
  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.
    memset(cookies[i].cookie, random(), cookies[i].length);
data/chrony-4.0/test/unit/nts_ntp_client.c:86:17:  [3] (random) random:
  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.
  info.length = random() % (sizeof (packet) + 1);
data/chrony-4.0/test/unit/nts_ntp_client.c:87:7:  [3] (random) random:
  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.
  if (random() % 4 != 0)
data/chrony-4.0/test/unit/nts_ntp_client.c:90:32:  [3] (random) random:
  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.
  if (inst->num_cookies > 0 && random() % 2) {
data/chrony-4.0/test/unit/nts_ntp_client.c:97:59:  [3] (random) random:
  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.
    inst->next_nke_attempt = SCH_GetLastEventMonoTime() + random() % 10 - 7;
data/chrony-4.0/test/unit/nts_ntp_client.c:149:13:  [3] (random) random:
  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.
    index = random() % (nak ? 2 : 8);
data/chrony-4.0/test/unit/nts_ntp_client.c:165:18:  [3] (random) random:
  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.
  nonce_length = random() % (sizeof (nonce)) + 1;
data/chrony-4.0/test/unit/nts_ntp_client.c:168:21:  [3] (random) random:
  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.
    cookie_length = random() % (sizeof (cookie) + 1);
data/chrony-4.0/test/unit/nts_ntp_client.c:173:21:  [3] (random) random:
  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.
  min_auth_length = random() % (512 + 1);
data/chrony-4.0/test/unit/nts_ntp_client.c:181:53:  [3] (random) random:
  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.
  if (cookie_length >= 12 && cookie_length <= 32 && random() % 2 == 0)
data/chrony-4.0/test/unit/nts_ntp_client.c:186:14:  [3] (random) random:
  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.
    for (i = random() % ((sizeof (plaintext) - 16) / (cookie_length + 4)); i >= 0; i--) {
data/chrony-4.0/test/unit/nts_ntp_client.c:189:56:  [3] (random) random:
  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.
                              i == 0 ? cookie_length : random() % (cookie_length + 1) / 4 * 4,
data/chrony-4.0/test/unit/nts_ntp_client.c:237:13:  [3] (random) random:
  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.
    valid = random() % 2;
data/chrony-4.0/test/unit/nts_ntp_client.c:242:9:  [3] (random) random:
  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.
    if (random() % 2) {
data/chrony-4.0/test/unit/nts_ntp_client.c:247:16:  [3] (random) random:
  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.
      for (j = random() % 3; j > 0; j--) {
data/chrony-4.0/test/unit/nts_ntp_client.c:269:9:  [3] (random) random:
  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.
    if (random() % 10 == 0) {
data/chrony-4.0/test/unit/nts_ntp_server.c:61:13:  [3] (random) random:
  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.
    index = random() % 3;
data/chrony-4.0/test/unit/nts_ntp_server.c:75:12:  [3] (random) random:
  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.
  for (i = random() % 4; i > 0; i--)
data/chrony-4.0/test/unit/nts_ntp_server.c:92:34:  [3] (random) random:
  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.
                                (random() % 2 ? cookie_start : auth_start))) +
data/chrony-4.0/test/unit/nts_ntp_server.c:93:35:  [3] (random) random:
  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.
                              4 + random() % 16]++;
data/chrony-4.0/test/unit/nts_ntp_server.c:134:13:  [3] (random) random:
  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.
    valid = random() % 2;
data/chrony-4.0/test/unit/nts_ntp_server.c:135:11:  [3] (random) random:
  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.
    nak = random() % 2;
data/chrony-4.0/test/unit/regress.c:38:17:  [3] (random) random:
  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.
      slope2 = (random() % 2 ? 1 : -1) * TST_GetRandomDouble(0.1, 0.5);
data/chrony-4.0/test/unit/regress.c:70:11:  [3] (random) random:
  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.
        y[random() % n] += 100 * sd;
data/chrony-4.0/test/unit/regress.c:80:16:  [3] (random) random:
  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.
        x[j] = random() % 4 * TST_GetRandomDouble(-1000, 1000);
data/chrony-4.0/test/unit/regress.c:95:52:  [3] (random) random:
  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.
      xrange = TST_GetRandomDouble(1e-6, pow(10.0, random() % 10));
data/chrony-4.0/test/unit/regress.c:96:16:  [3] (random) random:
  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.
      yrange = random() % 3 * TST_GetRandomDouble(0.0, pow(10.0, random() % 10));
data/chrony-4.0/test/unit/regress.c:96:66:  [3] (random) random:
  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.
      yrange = random() % 3 * TST_GetRandomDouble(0.0, pow(10.0, random() % 10));
data/chrony-4.0/test/unit/regress.c:97:16:  [3] (random) random:
  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.
      wrange = random() % 3 * TST_GetRandomDouble(0.0, pow(10.0, random() % 10));
data/chrony-4.0/test/unit/regress.c:97:66:  [3] (random) random:
  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.
      wrange = random() % 3 * TST_GetRandomDouble(0.0, pow(10.0, random() % 10));
data/chrony-4.0/test/unit/regress.c:98:17:  [3] (random) random:
  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.
      x2range = random() % 3 * TST_GetRandomDouble(0.0, pow(10.0, random() % 10));
data/chrony-4.0/test/unit/regress.c:98:67:  [3] (random) random:
  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.
      x2range = random() % 3 * TST_GetRandomDouble(0.0, pow(10.0, random() % 10));
data/chrony-4.0/test/unit/regress.c:99:11:  [3] (random) random:
  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.
      m = random() % n;
data/chrony-4.0/test/unit/samplefilt.c:42:19:  [3] (random) random:
  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.
    max_samples = random() % 20 + 1;
data/chrony-4.0/test/unit/samplefilt.c:43:19:  [3] (random) random:
  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.
    min_samples = random() % (max_samples) + 1;
data/chrony-4.0/test/unit/samplefilt.c:62:29:  [3] (random) random:
  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.
        sample_in.stratum = random() % 16;
data/chrony-4.0/test/unit/samplefilt.c:81:11:  [3] (random) random:
  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.
      if (random() % 10) {
data/chrony-4.0/test/unit/smooth.c:45:15:  [3] (random) random:
  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.
    offset = (random() % 1000000 - 500000) / 1.0e6;
data/chrony-4.0/test/unit/smooth.c:46:13:  [3] (random) random:
  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.
    freq = (random() % 1000000 - 500000) / 1.0e9;
data/chrony-4.0/test/unit/sources.c:61:25:  [3] (random) random:
  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.
      sel_options = i & random() & (SRC_SELECT_NOSELECT | SRC_SELECT_PREFER |
data/chrony-4.0/test/unit/sources.c:84:13:  [3] (random) random:
  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.
        if (random() % 2)
data/chrony-4.0/test/unit/sources.c:85:38:  [3] (random) random:
  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.
          SRC_SetLeapStatus(srcs[j], random() % 4);
data/chrony-4.0/test/unit/sources.c:180:19:  [3] (random) random:
  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.
    sel_options = random() & (SRC_SELECT_PREFER | SRC_SELECT_TRUST | SRC_SELECT_REQUIRE);
data/chrony-4.0/test/unit/sources.c:182:10:  [3] (random) random:
  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.
    n1 = random() % 3;
data/chrony-4.0/test/unit/sources.c:183:10:  [3] (random) random:
  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.
    n2 = random() % 3;
data/chrony-4.0/test/unit/sources.c:184:10:  [3] (random) random:
  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.
    n3 = random() % 3;
data/chrony-4.0/test/unit/sources.c:185:10:  [3] (random) random:
  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.
    n4 = random() % 3;
data/chrony-4.0/test/unit/sources.c:189:56:  [3] (random) random:
  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.
      srcs[j] = create_source(SRC_REFCLOCK, &addrs[j], random() % 2, sel_options);
data/chrony-4.0/test/unit/sources.c:195:31:  [3] (random) random:
  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.
      srcs[j] = create_source(random() % 2 ? SRC_REFCLOCK : SRC_NTP, &addrs[j],
data/chrony-4.0/test/unit/sources.c:196:31:  [3] (random) random:
  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.
                              random() % 2, sel_options | SRC_SELECT_NOSELECT);
data/chrony-4.0/test/unit/test.c:70:3:  [3] (random) srandom:
  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.
  srandom(seed ? seed : tv.tv_sec ^ (tv.tv_usec << 10));
data/chrony-4.0/test/unit/test.c:99:24:  [3] (random) random:
  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.
  return min + (double)random() / RAND_MAX * (max - min);
data/chrony-4.0/test/unit/test.c:106:14:  [3] (random) random:
  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.
    family = random() % 2 ? IPADDR_INET4 : IPADDR_INET6;
data/chrony-4.0/test/unit/test.c:116:32:  [3] (random) random:
  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.
      ip->addr.in4 = (uint32_t)random() % (1U << (bits - 16)) << 16 |
data/chrony-4.0/test/unit/test.c:117:32:  [3] (random) random:
  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.
                     (uint32_t)random() % (1U << 16);
data/chrony-4.0/test/unit/test.c:119:32:  [3] (random) random:
  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.
      ip->addr.in4 = (uint32_t)random() % (1U << bits);
data/chrony-4.0/test/unit/test.c:131:27:  [3] (random) random:
  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.
        ip->addr.in6[i] = random() % (1U << MIN(bits - b, 8));
data/chrony-4.0/test/unit/util.c:234:9:  [3] (random) random:
  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.
    j = random() % (sizeof (buf) + 1);
data/chrony-4.0/array.c:116: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(e, element, array->elem_size);
data/chrony-4.0/client.c:107: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 line[2048];
data/chrony-4.0/client.c:1268: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 *name, **names[TAB_COMPLETE_MAX_INDEX];
data/chrony-4.0/client.c:1317: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 first[32];
data/chrony-4.0/client.c:1755: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/chrony-4.0/client.c:1797:15:  [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).
      width = atoi(format);
data/chrony-4.0/client.c:1804:14:  [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).
      prec = atoi(format);
data/chrony-4.0/client.c:2087: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 name[256];
data/chrony-4.0/client.c:2111: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 name[256], mode_ch, state_ch;
data/chrony-4.0/client.c:2219: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 name[256];
data/chrony-4.0/client.c:2283: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 name[256];
data/chrony-4.0/client.c:2339: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 name[256];
data/chrony-4.0/client.c:2538: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 name[256];
data/chrony-4.0/client.c:2732: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 header[80], name[50], *opt, *arg;
data/chrony-4.0/client.c:3117:13:  [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).
  timeout = atoi(line);
data/chrony-4.0/client.c:3133:13:  [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).
  retries = atoi(line);
data/chrony-4.0/client.c:3148: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 key[512];
data/chrony-4.0/client.c:3150: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 *words[3];
data/chrony-4.0/client.c:3550: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).
        port = atoi(optarg);
data/chrony-4.0/cmdmon.c:1400: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(&rx_message, sck_message->data, read_length);
data/chrony-4.0/conf.c:480: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 line[MAX_LINE_LENGTH + 1];
data/chrony-4.0/conf.c:847: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 ref[5];
data/chrony-4.0/conf.c:1458: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 *p, filter[5];
data/chrony-4.0/conf.c:1547: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 *dirs[MAX_CONF_DIRS], buf[MAX_LINE_LENGTH], *path;
data/chrony-4.0/conf.c:1638: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 line[MAX_LINE_LENGTH + 1];
data/chrony-4.0/conf.c:1690: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[MAX_LINE_LENGTH];
data/chrony-4.0/conf.c:1700: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(prev_ids, ARR_GetElements(ntp_source_ids), prev_size * sizeof (prev_ids[0]));
data/chrony-4.0/conf.c:1702: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(prev_sources, ARR_GetElements(ntp_sources), prev_size * sizeof (prev_sources[0]));
data/chrony-4.0/conf.c:1803: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 dummy_hostname[2] = "H";
data/chrony-4.0/getdate.c:135:65:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy)
data/chrony-4.0/getdate.c:136:10:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
# define bcopy(from, to, len) memcpy ((to), (from), (len))
data/chrony-4.0/getdate.c:136:31:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
# define bcopy(from, to, len) memcpy ((to), (from), (len))
data/chrony-4.0/getdate.c:1125: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 const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
data/chrony-4.0/getdate.c:1320: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 yymsgbuf[128];
data/chrony-4.0/getdate.c:2591: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 buff[20];
data/chrony-4.0/getdate.c:2793: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 buff[MAX_BUFF_LEN + 1];
data/chrony-4.0/hash_intmd5.c:63: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(out, ctx.digest, out_len);
data/chrony-4.0/hash_nss.c:81: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 buf[MAX_HASH_LENGTH];
data/chrony-4.0/hash_nss.c:94: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(out, buf, ret);
data/chrony-4.0/hash_tomcrypt.c:96: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 buf[MAX_HASH_LENGTH];
data/chrony-4.0/hash_tomcrypt.c:115: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(out, buf, len);
data/chrony-4.0/keys.c:170: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 line[2048], *key_file, *key_value;
data/chrony-4.0/keys.c:224: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(key.data.ntp_mac.value, key_value, key_length);
data/chrony-4.0/keys.c:324: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 buf[MAX_HASH_LENGTH];
data/chrony-4.0/keys.c:398: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 buf[MAX_HASH_LENGTH];
data/chrony-4.0/logging.c:137: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[2048];
data/chrony-4.0/logging.c:315: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 bannerline[256];
data/chrony-4.0/main.c:319: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 message[1024];
data/chrony-4.0/main.c:364: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(DEV_NULL, O_RDONLY) != STDIN_FILENO ||
data/chrony-4.0/main.c:365: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).
          open(DEV_NULL, O_WRONLY) != STDOUT_FILENO ||
data/chrony-4.0/main.c:366: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).
          open(DEV_NULL, O_RDWR) != STDERR_FILENO)
data/chrony-4.0/md5.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.
unsigned char PADDING[64] = {
data/chrony-4.0/md5.h:44: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 in[64];                              /* input buffer */
data/chrony-4.0/md5.h:45: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[16];     /* actual digest after MD5Final call */
data/chrony-4.0/nameserv.c:102: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(&ip_addrs[i].addr.in6, &((struct sockaddr_in6 *)ai->ai_addr)->sin6_addr.s6_addr,
data/chrony-4.0/nameserv.c:165: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 hbuf[NI_MAXHOST];
data/chrony-4.0/ntp_core.c:291: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.
static const char leap_chars[4] = {'N', '+', '-', '?'};
data/chrony-4.0/ntp_core.c:292: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.
static const char tss_chars[3] = {'D', 'K', 'H'};
data/chrony-4.0/ntp_ext.c:75: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(ef_body, body, body_length);
data/chrony-4.0/ntp_ext.c:118: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(ef_body, body, body_length);
data/chrony-4.0/ntp_io_linux.c:52: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 name[IF_NAMESIZE];
data/chrony-4.0/ntp_signd.c:124: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 path[PATH_MAX];
data/chrony-4.0/ntp_signd.c:330: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(&inst->request.packet_to_sign, packet, info->length);
data/chrony-4.0/ntp_sources.c:281: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(temp_records, ARR_GetElements(records), old_size * sizeof (SourceRecord));
data/chrony-4.0/nts_ke.h:67: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 key[NKE_MAX_KEY_LENGTH];
data/chrony-4.0/nts_ke.h:78: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 cookie[NKE_MAX_COOKIE_LENGTH];
data/chrony-4.0/nts_ke_client.c:55: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 server_name[NKE_MAX_RECORD_BODY_LENGTH + 1];
data/chrony-4.0/nts_ke_client.c:184: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(inst->cookies[inst->num_cookies].cookie, data, length);
data/chrony-4.0/nts_ke_client.c:195: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(inst->server_name, data, length);
data/chrony-4.0/nts_ke_client.c:321: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 label[512], *iface;
data/chrony-4.0/nts_ke_server.c:64: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 nonce[SERVER_COOKIE_NONCE_LENGTH];
data/chrony-4.0/nts_ke_server.c:69: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 key[SIV_MAX_KEY_LENGTH];
data/chrony-4.0/nts_ke_server.c:75: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 key[SIV_MAX_KEY_LENGTH];
data/chrony-4.0/nts_ke_server.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 buf[SIV_MAX_KEY_LENGTH * 2 + 1], *dump_dir;
data/chrony-4.0/nts_ke_server.c:562: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 *dump_dir, line[1024], *words[MAX_WORDS];
data/chrony-4.0/nts_ke_server.c:563: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 key[SIV_MAX_KEY_LENGTH];
data/chrony-4.0/nts_ke_server.c:598: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(server_keys[index].key, key, key_length);
data/chrony-4.0/nts_ke_server.c:681: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 prefix[16];
data/chrony-4.0/nts_ke_server.c:852: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 plaintext[2 * NKE_MAX_KEY_LENGTH], *ciphertext;
data/chrony-4.0/nts_ke_server.c:883: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(plaintext, context->c2s.key, context->c2s.length);
data/chrony-4.0/nts_ke_server.c:884: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(plaintext + context->c2s.length, context->s2c.key, context->s2c.length);
data/chrony-4.0/nts_ke_server.c:907: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 plaintext[2 * NKE_MAX_KEY_LENGTH], *ciphertext;
data/chrony-4.0/nts_ke_server.c:960: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(context->c2s.key, plaintext, context->c2s.length);
data/chrony-4.0/nts_ke_server.c:961: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(context->s2c.key, plaintext + context->c2s.length, context->s2c.length);
data/chrony-4.0/nts_ke_session.c:57: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 data[NKE_MAX_MESSAGE_LENGTH];
data/chrony-4.0/nts_ke_session.c:121: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(&message->data[message->length], &header, sizeof (header));
data/chrony-4.0/nts_ke_session.c:125: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(&message->data[message->length], body, body_length);
data/chrony-4.0/nts_ke_session.c:167: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(body, &message->data[message->parsed + sizeof (header)], MIN(buffer_length, blen));
data/chrony-4.0/nts_ke_session.c:214: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 alpn_name[sizeof (NKE_ALPN_NAME)];
data/chrony-4.0/nts_ntp_auth.c:109: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(body, nonce, nonce_length);
data/chrony-4.0/nts_ntp_client.c:73: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 nonce[NTS_MIN_UNPADDED_NONCE_LENGTH];
data/chrony-4.0/nts_ntp_client.c:74: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 uniq_id[NTS_MIN_UNIQ_ID_LENGTH];
data/chrony-4.0/nts_ntp_client.c:420: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(inst->cookies[index].cookie, ef_body, ef_body_length);
data/chrony-4.0/nts_ntp_client.c:440: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 plaintext[NTP_MAX_EXTENSIONS_LENGTH];
data/chrony-4.0/nts_ntp_client.c:538: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[2 * NKE_MAX_COOKIE_LENGTH + 2], *dump_dir, *filename;
data/chrony-4.0/nts_ntp_client.c:598: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 line[2 * NKE_MAX_COOKIE_LENGTH + 2], *dump_dir, *filename, *words[MAX_WORDS];
data/chrony-4.0/nts_ntp_server.c:48: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 nonce[NTS_MIN_UNPADDED_NONCE_LENGTH];
data/chrony-4.0/nts_ntp_server.c:94: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 plaintext[NTP_MAX_EXTENSIONS_LENGTH];
data/chrony-4.0/nts_ntp_server.c:128: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(cookie.cookie, ef_body, ef_body_length);
data/chrony-4.0/nts_ntp_server.c:229: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 plaintext[NTP_MAX_EXTENSIONS_LENGTH];
data/chrony-4.0/privops.c:78: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 name[256];
data/chrony-4.0/privops.c:113: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 msg[256];
data/chrony-4.0/privops.c:180: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(req, message->data, sizeof (*req));
data/chrony-4.0/privops.c:561: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(&req.data.bind_socket.sa.u, address, address_len);
data/chrony-4.0/refclock.c:220: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.
    unsigned char ref[5] = { 0, 0, 0, 0, 0 };
data/chrony-4.0/refclock.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 sync_stats[4] = {'N', '+', '-', '?'};
data/chrony-4.0/refclock_phc.c:82:20:  [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).
    phc->pin = s ? atoi(s) : 0;
data/chrony-4.0/refclock_phc.c:84:24:  [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).
    phc->channel = s ? atoi(s) : 0;
data/chrony-4.0/refclock_pps.c:63: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, O_RDWR);
data/chrony-4.0/refclock_shm.c:69: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).
  param = atoi(RCL_GetDriverParameter(instance));
data/chrony-4.0/reference.c:488: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[BUFLEN], host[BUFLEN];
data/chrony-4.0/reference.c:503:9:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
        strcpy(host, "<UNKNOWN>");
data/chrony-4.0/reference.c:600: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 *tz_env, tz_orig[128];
data/chrony-4.0/reference.c:834: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 leap_codes[4] = {'N', '+', '-', '?'};
data/chrony-4.0/regress.c:406: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 flags[MAX_POINTS];
data/chrony-4.0/regress.c:420: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 flags[MAX_POINTS];
data/chrony-4.0/regress.c:440: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(tmp, x, n * sizeof (tmp[0]));
data/chrony-4.0/rtc_linux.c:387: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 line[256];
data/chrony-4.0/rtc_linux.c:511: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(CNF_GetRtcDevice(), O_RDWR);
data/chrony-4.0/rtc_linux.c:948: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(CNF_GetRtcDevice(), O_RDONLY);
data/chrony-4.0/siv_nettle_int.c:200: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(&ctx->block.b[ctx->index], msg, len);
data/chrony-4.0/siv_nettle_int.c:229: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(ctx->block.b, msg, msg_len);
data/chrony-4.0/siv_nettle_int.c:264: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(dst, ctx->block.b, length);
data/chrony-4.0/siv_nettle_int.c:382: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(pad.b, pdata, plength);
data/chrony-4.0/siv_nettle_int.c:397: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(ctx->s2vk, key, 16);
data/chrony-4.0/siv_nettle_int.c:419: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(dst, siv.b, SIV_DIGEST_SIZE);
data/chrony-4.0/siv_nettle_int.c:436: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(ctr.b, src, SIV_DIGEST_SIZE);
data/chrony-4.0/socket.c:643: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 if_index[20], tss[10], tsif[20], tslen[20];
data/chrony-4.0/socket.c:1597: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(&((struct sockaddr_in6 *)sa)->sin6_addr.s6_addr, ip_sa->ip_addr.addr.in6,
data/chrony-4.0/sources.c:579: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[320], *name, *ntp_name;
data/chrony-4.0/sources.c:1326: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 filename[64], *dumpdir;
data/chrony-4.0/sources.c:1388: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 pattern[PATH_MAX], name[64], *dumpdir, *s;
data/chrony-4.0/sourcestats.c:908: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 line[1024];
data/chrony-4.0/sys_linux.c:431: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 cap_text[256];
data/chrony-4.0/sys_linux.c:582:14:  [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).
    SCMP_SYS(open),
data/chrony-4.0/sys_linux.c:895: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 phc_path[64];
data/chrony-4.0/sys_linux.c:904: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).
  phc_fd = open(path, O_RDONLY);
data/chrony-4.0/sys_netbsd.c:152: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/clockctl", O_WRONLY);
data/chrony-4.0/tempcomp.c:122: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 line[256];
data/chrony-4.0/test/unit/cmac.c:33:18:  [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 unsigned char key[MAX_KEY_LENGTH];
data/chrony-4.0/test/unit/cmac.c:35:18:  [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 unsigned char hash[MAX_HASH_LENGTH];
data/chrony-4.0/test/unit/cmac.c:43: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 hash[MAX_HASH_LENGTH];
data/chrony-4.0/test/unit/hash.c:30:18:  [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 unsigned char out[MAX_HASH_LENGTH];
data/chrony-4.0/test/unit/hash.c:39: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 out[MAX_HASH_LENGTH];
data/chrony-4.0/test/unit/keys.c:35: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 key[128];
data/chrony-4.0/test/unit/keys.c:92: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(name, "w");
data/chrony-4.0/test/unit/keys.c:104: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 data[100], auth[MAX_HASH_LENGTH];
data/chrony-4.0/test/unit/ntp_auth.c:39: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 buf[64];
data/chrony-4.0/test/unit/ntp_auth.c:78: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 buf[64];
data/chrony-4.0/test/unit/ntp_core.c:44:57:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define NIO_SendPacket(msg, to, from, len, process_tx) (memcpy(&req_buffer, msg, len), req_length = len, 1)
data/chrony-4.0/test/unit/ntp_core.c:191: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.
    unsigned char buf[128];
data/chrony-4.0/test/unit/ntp_core.c:234: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.
        ((unsigned char *)res)[res_length - auth_len + random() % auth_len]++;
data/chrony-4.0/test/unit/ntp_ext.c:34: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 *buffer, body[NTP_MAX_EXTENSIONS_LENGTH];
data/chrony-4.0/test/unit/nts_ke_session.c:33:17:  [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 unsigned char record[NKE_MAX_MESSAGE_LENGTH];
data/chrony-4.0/test/unit/nts_ke_session.c:82: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 buffer[NKE_MAX_MESSAGE_LENGTH];
data/chrony-4.0/test/unit/nts_ntp_auth.c:34: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 key[SIV_MAX_KEY_LENGTH], nonce[256], plaintext[256], plaintext2[256];
data/chrony-4.0/test/unit/nts_ntp_client.c:77: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 nonce[NTS_MIN_UNPADDED_NONCE_LENGTH], uniq_id[NTS_MIN_UNIQ_ID_LENGTH];
data/chrony-4.0/test/unit/nts_ntp_client.c:134: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 cookie[508], plaintext[528], nonce[448];
data/chrony-4.0/test/unit/nts_ntp_client.c:157: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.
    ((unsigned char *)packet)[NTP_HEADER_LENGTH + 4]++;
data/chrony-4.0/test/unit/nts_ntp_client.c:210: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.
    ((unsigned char *)packet)[auth_start + 8]++;
data/chrony-4.0/test/unit/nts_ntp_server.c:34: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 uniq_id[NTS_MIN_UNIQ_ID_LENGTH], nonce[NTS_MIN_UNPADDED_NONCE_LENGTH];
data/chrony-4.0/test/unit/nts_ntp_server.c:90: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.
    ((unsigned char *)packet)[(index == 2 ? cookie_start :
data/chrony-4.0/test/unit/siv.c:31:18:  [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 unsigned char key[64];
data/chrony-4.0/test/unit/siv.c:33:18:  [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 unsigned char nonce[128];
data/chrony-4.0/test/unit/siv.c:35:18:  [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 unsigned char assoc[128];
data/chrony-4.0/test/unit/siv.c:37:18:  [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 unsigned char plaintext[128];
data/chrony-4.0/test/unit/siv.c:39:18:  [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 unsigned char ciphertext[128];
data/chrony-4.0/test/unit/siv.c:131: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 plaintext[sizeof (((struct siv_test *)NULL)->plaintext)];
data/chrony-4.0/test/unit/siv.c:132: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 ciphertext[sizeof (((struct siv_test *)NULL)->ciphertext)];
data/chrony-4.0/test/unit/sources.c:43: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 conf[128];
data/chrony-4.0/test/unit/test.c:62:14:  [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).
      seed = atoi(argv[++i]);
data/chrony-4.0/test/unit/util.c:33: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[16], *s, *words[3];
data/chrony-4.0/test/unit/util.c:329: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, "AB123456780001", 15);
data/chrony-4.0/util.c:224: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 buffer_pool[POOL_ENTRIES][BUFFER_LENGTH];
data/chrony-4.0/util.c:395: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 buf[16];
data/chrony-4.0/util.c:601: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.
    ((unsigned char *)ts)[start] %= 1U << bits;
data/chrony-4.0/util.c:1048: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(dir, path, dir_len);
data/chrony-4.0/util.c:1214: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 path[PATH_MAX];
data/chrony-4.0/util.c:1248: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, flags, perm);
data/chrony-4.0/util.c:1282: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 old_path[PATH_MAX], new_path[PATH_MAX];
data/chrony-4.0/util.c:1311: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 path[PATH_MAX];
data/chrony-4.0/util.c:1374: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 rand_buf[256];
data/chrony-4.0/util.c:1427:58:  [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.
        snprintf(hex + l, hex_len - l, "%02hhX", ((const char *)buf)[i]) != 2)
data/chrony-4.0/util.c:1439: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 *p, byte[3];
data/chrony-4.0/util.c:1448: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)[i] = strtol(byte, &p, 16);
data/chrony-4.0/client.c:123:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(line, cmd, sizeof(line) - 1);
data/chrony-4.0/client.c:228: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).
      local_addr_len = strlen(dir) + 50;
data/chrony-4.0/client.c:1055: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(data.name) >= sizeof (msg->data.ntp_source.name) ||
data/chrony-4.0/client.c:1068: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(data.name) >= sizeof (msg->data.ntp_source.name))
data/chrony-4.0/client.c:1070:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy((char *)msg->data.ntp_source.name, data.name,
data/chrony-4.0/client.c:1239: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(s);
data/chrony-4.0/client.c:1300: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(text);
data/chrony-4.0/client.c:1739: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(header);
data/chrony-4.0/client.c:2055: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).
    if (trunc_dns > 0 && strlen(buf) > trunc_dns) {
data/chrony-4.0/client.c:3415: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).
    total_length += strlen(argv[i]) + 1;
data/chrony-4.0/client.c:3428:11:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
          strcat(line, " ");
data/chrony-4.0/cmdmon.c:1232: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(name) >= sizeof (tx_message->data.ntp_source_name.name))
data/chrony-4.0/cmdmon.c:1236:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy((char *)tx_message->data.ntp_source_name.name, name,
data/chrony-4.0/conf.c:511: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) >= MAX_LINE_LENGTH)
data/chrony-4.0/conf.c:892:11:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
      if (sscanf(line, "%4s%n", (char *)ref, &n) != 1)
data/chrony-4.0/conf.c:896:11:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
      if (sscanf(line, "%4s%n", (char *)ref, &n) != 1)
data/chrony-4.0/conf.c:1502:11:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
      if (sscanf(line, "%4s%n", filter, &n) != 1)
data/chrony-4.0/conf.c:1578: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).
          if (strncmp(path, dirs[j], strlen(dirs[j])) == 0 &&
data/chrony-4.0/conf.c:1579: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).
              strlen(dirs[j]) + 1 + strlen(get_basename(path)) == strlen(path)) {
data/chrony-4.0/conf.c:1579: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).
              strlen(dirs[j]) + 1 + strlen(get_basename(path)) == strlen(path)) {
data/chrony-4.0/conf.c:1579:67:  [1] (buffer) strlen:
  Does not handle 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(dirs[j]) + 1 + strlen(get_basename(path)) == strlen(path)) {
data/chrony-4.0/conf.c:1646: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).
    if (strlen(line) >= MAX_LINE_LENGTH)
data/chrony-4.0/getdate.c:1023: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).
#   define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
data/chrony-4.0/getdate.c:2492: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 (buff) == 3)
data/chrony-4.0/getdate.c:2494: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).
  else if (strlen (buff) == 4 && buff[3] == '.')
data/chrony-4.0/getdate.c:2537: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).
  i = strlen (buff) - 1;
data/chrony-4.0/keys.c:130: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(key);
data/chrony-4.0/logging.c:177: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).
        if (write(parent_fd, buf, strlen(buf) + 1) < 0)
data/chrony-4.0/logging.c:318: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).
    bannerlen = MIN(strlen(logfiles[id].banner), sizeof (bannerline) - 1);
data/chrony-4.0/main.c:323:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    r = read(pipefd[0], message, sizeof (message));
data/chrony-4.0/nts_ke_server.c:364: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).
                          ntp_server, strlen(ntp_server)))
data/chrony-4.0/nts_ke_session.c:228:71:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    r = gnutls_server_name_set(session, GNUTLS_NAME_DNS, server_name, strlen(server_name));
data/chrony-4.0/refclock.c:208: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).
    inst->driver_parameter_length = strlen(inst->driver_parameter);
data/chrony-4.0/refclock.c:333: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).
  option += strlen(option) + 1;
data/chrony-4.0/refclock.c:351: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(options[i]);
data/chrony-4.0/refclock.c:368: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(name);
data/chrony-4.0/reference.c:622: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).
    if (strlen(tz_env) >= sizeof (tz_orig))
data/chrony-4.0/rtc_linux.c:778:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  status = read(fd, &data, sizeof(data));
data/chrony-4.0/socket.c:343: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).
  if (setsockopt(sock_fd, SOL_SOCKET, SO_BINDTODEVICE, iface, strlen(iface) + 1) < 0) {
data/chrony-4.0/sources.c:1407: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).
    if (strlen(name) < 4)
data/chrony-4.0/sources.c:1409: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).
    name[strlen(name) - 4] = '\0';
data/chrony-4.0/sys_linux.c:595:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    SCMP_SYS(read),
data/chrony-4.0/sys_linux.c:989:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read(fd, &extts_event, sizeof (extts_event)) != sizeof (extts_event)) {
data/chrony-4.0/test/unit/util.c:283:3:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
  umask(0);
data/chrony-4.0/util.c:1107: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).
  p = (char *)Malloc(1 + strlen(path));

ANALYSIS SUMMARY:

Hits = 427
Lines analyzed = 54208 in approximately 1.40 seconds (38614 lines/second)
Physical Source Lines of Code (SLOC) = 35521
Hits@level = [0] 329 [1]  45 [2] 185 [3] 165 [4]  27 [5]   5
Hits@level+ = [0+] 756 [1+] 427 [2+] 382 [3+] 197 [4+]  32 [5+]   5
Hits/KSLOC@level+ = [0+] 21.2832 [1+] 12.0211 [2+] 10.7542 [3+] 5.54602 [4+] 0.900876 [5+] 0.140762
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.