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/proftpd-mod-clamav-0.14~rc2/mod_clamav.h Examining data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c FINAL RESULTS: data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c:303:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(scancmd, "SCAN %s\n", abs_filename); data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c:67: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[4096], *pt, *pt1; data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c:154: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[32]; data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c:228:8: [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). fd = fopen(rel_filename, "r"); data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c:507: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[PR_TUNABLE_PATH_MAX + 1]; data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c:762:33: [2] (integer) atol: 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). *((int *) c->argv[0]) = (int) atol(cmd->argv[1]); data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c:779: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 ulong_max[80] = {'\0'}; data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c:780:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ulong_max, "%lu", (unsigned long) ULONG_MAX); data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c:810: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 ulong_max[80] = {'\0'}; data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c:811:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ulong_max, "%lu", (unsigned long) ULONG_MAX); data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c:294:20: [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). scancmd = calloc(strlen(abs_filename) + 20, sizeof(char)); data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c:322:29: [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(sockd, scancmd, strlen(scancmd)) <= 0) { data/proftpd-mod-clamav-0.14~rc2/mod_clamav.c:377:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(server.sun_path, clamd_host, sizeof(server.sun_path)); ANALYSIS SUMMARY: Hits = 13 Lines analyzed = 925 in approximately 0.03 seconds (27866 lines/second) Physical Source Lines of Code (SLOC) = 611 Hits@level = [0] 1 [1] 3 [2] 9 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 14 [1+] 13 [2+] 10 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 22.9133 [1+] 21.2766 [2+] 16.3666 [3+] 1.63666 [4+] 1.63666 [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.