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/libapr-memcache-0.7.0/test/test_all.c Examining data/libapr-memcache-0.7.0/test/test_get.c Examining data/libapr-memcache-0.7.0/test/test_set.c Examining data/libapr-memcache-0.7.0/test/test_stats.c Examining data/libapr-memcache-0.7.0/memcache/apr_memcache.c Examining data/libapr-memcache-0.7.0/memcache/apr_memcache.h FINAL RESULTS: data/libapr-memcache-0.7.0/memcache/apr_memcache.c:529:12: [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. klen = snprintf(conn->buffer, BUFFER_SIZE, " %u %u %u" MC_EOL, flags, timeout, data_size); data/libapr-memcache-0.7.0/memcache/apr_memcache.c:782:12: [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. klen = snprintf(conn->buffer, BUFFER_SIZE, " %u" MC_EOL, timeout); data/libapr-memcache-0.7.0/memcache/apr_memcache.c:851:12: [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. klen = snprintf(conn->buffer, BUFFER_SIZE, " %u" MC_EOL, inc); data/libapr-memcache-0.7.0/test/test_all.c:6:19: [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 out(funa) fprintf(stdout, funa " : %d %s\n", rv, apr_strerror(rv, buf, sizeof buf)); data/libapr-memcache-0.7.0/test/test_get.c:6:19: [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 out(funa) fprintf(stdout, funa " : %d %s\n", rv, apr_strerror(rv, buf, sizeof buf)); data/libapr-memcache-0.7.0/test/test_set.c:6:19: [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 out(funa) fprintf(stdout, funa " : %d %s\n", rv, apr_strerror(rv, buf, sizeof buf)); data/libapr-memcache-0.7.0/test/test_stats.c:6:19: [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 out(funa) fprintf(stdout, funa " : %d %s\n", rv, apr_strerror(rv, buf, sizeof buf)); data/libapr-memcache-0.7.0/memcache/apr_memcache.c:683: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). *flags_ = atoi(flags); data/libapr-memcache-0.7.0/memcache/apr_memcache.c:686: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). len = atoi(length); data/libapr-memcache-0.7.0/memcache/apr_memcache.c:879:26: [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). *new_value = atoi(conn->buffer); data/libapr-memcache-0.7.0/memcache/apr_memcache.c:1073:12: [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). return atoi(buf); data/libapr-memcache-0.7.0/memcache/apr_memcache.c:1085:30: [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). return apr_time_from_sec(atoi(buf)); data/libapr-memcache-0.7.0/memcache/apr_memcache.c:1097:26: [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). return apr_time_make(atoi(secs), atoi(usecs)); data/libapr-memcache-0.7.0/memcache/apr_memcache.c:1097:38: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). return apr_time_make(atoi(secs), atoi(usecs)); data/libapr-memcache-0.7.0/test/test_all.c:10: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 buf[120]; data/libapr-memcache-0.7.0/test/test_get.c:10: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 buf[120]; data/libapr-memcache-0.7.0/test/test_set.c:10: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 buf[120]; data/libapr-memcache-0.7.0/test/test_stats.c:10: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 buf[120]; data/libapr-memcache-0.7.0/memcache/apr_memcache.c:505: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). int key_size = strlen(key); data/libapr-memcache-0.7.0/memcache/apr_memcache.c:630:16: [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 klen = strlen(key); data/libapr-memcache-0.7.0/memcache/apr_memcache.c:761:16: [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 klen = strlen(key); data/libapr-memcache-0.7.0/memcache/apr_memcache.c:830:16: [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 klen = strlen(key); ANALYSIS SUMMARY: Hits = 22 Lines analyzed = 1832 in approximately 0.18 seconds (10015 lines/second) Physical Source Lines of Code (SLOC) = 1272 Hits@level = [0] 28 [1] 4 [2] 11 [3] 0 [4] 7 [5] 0 Hits@level+ = [0+] 50 [1+] 22 [2+] 18 [3+] 7 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 39.3082 [1+] 17.2956 [2+] 14.1509 [3+] 5.50314 [4+] 5.50314 [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.