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/python-persistent-4.6.4/persistent/_compat.h Examining data/python-persistent-4.6.4/persistent/_timestamp.c Examining data/python-persistent-4.6.4/persistent/cPersistence.c Examining data/python-persistent-4.6.4/persistent/cPersistence.h Examining data/python-persistent-4.6.4/persistent/cPickleCache.c Examining data/python-persistent-4.6.4/persistent/ring.c Examining data/python-persistent-4.6.4/persistent/ring.h FINAL RESULTS: data/python-persistent-4.6.4/persistent/cPersistence.c:1496:9: [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(buf, sizeof(buf) - 1, "%" PRIx64, oid_value); data/python-persistent-4.6.4/persistent/cPersistence.c:59:15: [3] (random) setstate: 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. INIT_STRING(setstate); data/python-persistent-4.6.4/persistent/cPersistence.h:104:11: [3] (random) setstate: 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. int (*setstate)(PyObject*); data/python-persistent-4.6.4/persistent/cPersistence.h:119:93: [3] (random) setstate: 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 PER_USE_OR_RETURN(O,R) {if((O)->state==cPersistent_GHOST_STATE && cPersistenceCAPI->setstate((PyObject*)(O)) < 0) return (R); else if ((O)->state==cPersistent_UPTODATE_STATE) (O)->state=cPersistent_STICKY_STATE;} data/python-persistent-4.6.4/persistent/cPersistence.h:150:25: [3] (random) setstate: 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. || (cPersistenceCAPI->setstate((PyObject*)(O)) >= 0)) \ data/python-persistent-4.6.4/persistent/_timestamp.c:100: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 data[8]; data/python-persistent-4.6.4/persistent/_timestamp.c:105: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 month_len[2][12] = data/python-persistent-4.6.4/persistent/_timestamp.c:344: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[128]; data/python-persistent-4.6.4/persistent/_timestamp.c:349:10: [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. len =sprintf(buf, "%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%09.6f", data/python-persistent-4.6.4/persistent/_timestamp.c:362: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 new[8]; data/python-persistent-4.6.4/persistent/_timestamp.c:377: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(new, o->data, 8); data/python-persistent-4.6.4/persistent/_timestamp.c:476: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(ts->data, buf, 8); data/python-persistent-4.6.4/persistent/cPersistence.c:83: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[1000]; data/python-persistent-4.6.4/persistent/cPersistence.c:1244:13: [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(self->serial, PyBytes_AS_STRING(v), 8); data/python-persistent-4.6.4/persistent/cPersistence.c:1459: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[20]; data/python-persistent-4.6.4/persistent/cPersistence.h:62: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 serial[8]; \ ANALYSIS SUMMARY: Hits = 16 Lines analyzed = 4165 in approximately 0.11 seconds (36892 lines/second) Physical Source Lines of Code (SLOC) = 2981 Hits@level = [0] 0 [1] 0 [2] 11 [3] 4 [4] 1 [5] 0 Hits@level+ = [0+] 16 [1+] 16 [2+] 16 [3+] 5 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 5.36733 [1+] 5.36733 [2+] 5.36733 [3+] 1.67729 [4+] 0.335458 [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.