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/rdate-1.10/src/ntp.c Examining data/rdate-1.10/src/ntpleaps.c Examining data/rdate-1.10/src/ntpleaps.h Examining data/rdate-1.10/src/rdate.c Examining data/rdate-1.10/src/rfc868time.c FINAL RESULTS: data/rdate-1.10/src/rdate.c:112:14: [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 ((c = getopt(argc, argv, "46psancvuo:t:b:")) != -1) data/rdate-1.10/src/ntp.c:445:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&data->recvck,packet+NTP_ORIGINATE,8); data/rdate-1.10/src/ntpleaps.c:113:2: [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(&res, ptr, 4); data/rdate-1.10/src/ntpleaps.c:128:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/usr/share/zoneinfo/right/UTC", O_RDONLY | O_NDELAY); data/rdate-1.10/src/rdate.c:151: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). port = atoi(optarg); data/rdate-1.10/src/rdate.c:155: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). maxdelay = atoi(optarg); data/rdate-1.10/src/rdate.c:159:23: [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). conditionalslide = atoi(optarg); data/rdate-1.10/src/rdate.c:216: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[80]; data/rdate-1.10/src/rdate.c:227: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 slidemsg[32]; data/rdate-1.10/src/rdate.c:230: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(slidemsg," (adjtime)"); data/rdate-1.10/src/rdate.c:232: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(slidemsg," (instant change)"); data/rdate-1.10/src/ntp.c:361:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). length = read(fd, receive, NTP_PACKET_MAX); data/rdate-1.10/src/ntpleaps.c:133:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buf, 4)) {}; data/rdate-1.10/src/ntpleaps.c:147:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buf, 28)) {}; data/rdate-1.10/src/ntpleaps.c:162:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buf, 12)) {}; data/rdate-1.10/src/ntpleaps.c:171:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buf, 8) != 8) { data/rdate-1.10/src/rdate.c:235:7: [1] (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 character. strcpy(slidemsg,""); data/rdate-1.10/src/rfc868time.c:113:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(s, &tim, sizeof(tim)) != sizeof(tim)) ANALYSIS SUMMARY: Hits = 18 Lines analyzed = 1178 in approximately 0.04 seconds (26471 lines/second) Physical Source Lines of Code (SLOC) = 701 Hits@level = [0] 32 [1] 7 [2] 10 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 50 [1+] 18 [2+] 11 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 71.3267 [1+] 25.6776 [2+] 15.6919 [3+] 1.42653 [4+] 0 [5+] 0 Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.