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/zodbpickle-1.0/src/zodbpickle/_pickle_33.c Examining data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c FINAL RESULTS: data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:5222: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. PyObject *setstate; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:5253:44: [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. result = _Unpickler_FastCall(self, setstate, state); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:5254:19: [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. Py_DECREF(setstate); data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:512: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->write_buf + self->buf_size, s, n); data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:749: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(r, s, n); data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:760: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 s[30]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:824: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 c_str[30]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1020: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. static const char *buf[2] = {FALSE, TRUE}; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1021: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. static char len[2] = {sizeof(FALSE)-1, sizeof(TRUE)-1}; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1037: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 c_str[32]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1099: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. char c_str[5]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1206: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. char str[9]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1215: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. char c_str[250]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1322: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. char header[5]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1398: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. char c_str[5]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1566: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. char c_str[5]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1655: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. char c_str[2]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1855: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 s[3]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:2108: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 s[3]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:2372: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. char c_str[5]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:2953: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. char bytes[2]; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:444: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->mt_table, self->mt_table, data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:752: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(buffer + self->output_len, s, n); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1012: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(input_line, line, len); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1230: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 pdata[30]; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1278: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 pdata[30]; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1475: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. static const char *buf[2] = { FALSE, TRUE }; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1476:11: [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 len[2] = {sizeof(FALSE) - 1, sizeof(TRUE) - 1}; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1493: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 pdata[32]; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1563: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. char header[5]; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1671: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. char pdata[9]; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1841: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. char header[5]; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1954: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. char pdata[5]; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:2048: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. char pdata[2]; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:2303: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 header[3]; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:2563: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 header[3]; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:2700: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. char pdata[5]; data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:3393: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. char header[2]; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:378:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PyObject *read; data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:602:33: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). (self->buf[i] = getc(self->fp)) == '\n') { data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:698:35: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). str = PyObject_Call(self->read, self->arg, NULL); data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:781: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). len = strlen(s); data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:864: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). len = strlen(c_str); data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1052:43: [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 (self->write_func(self, c_str, strlen(c_str)) < 0) data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1219:9: [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(c_str, "\n"); data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1221:43: [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 (self->write_func(self, c_str, strlen(c_str)) < 0) data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:1241:41: [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 (self->write_func(self, buf, strlen(buf)) < 0) data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:5814:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Py_XDECREF(self->read); data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:5838:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Py_VISIT(self->read); data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:5853:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Py_CLEAR(self->read); data/zodbpickle-1.0/src/zodbpickle/_pickle_27.c:6160:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). INIT_STR(read); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:363:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PyObject *read; /* read() method of the input stream. */ data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:883:41: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). r = PyObject_CallFunction(self->read, "n", consumed); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:914:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). assert(self->read != NULL); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:925:48: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). data = _Unpickler_FastCall(self, self->read, len); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:988:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!self->read) { data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1036:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (self->read) { data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1180:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). _Py_IDENTIFIER(read); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1196:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Py_CLEAR(self->read); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1243: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). len = strlen(pdata); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1293: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). len = strlen(pdata); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1506:41: [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 (_Pickler_Write(self, pdata, strlen(pdata)) < 0) data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:1692: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). if (_Pickler_Write(self, buf, strlen(buf)) < 0) data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:6134:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Py_XDECREF(self->read); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:6157:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Py_VISIT(self->read); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:6169:20: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Py_CLEAR(self->read); data/zodbpickle-1.0/src/zodbpickle/_pickle_33.c:6246:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (self->read != NULL) ANALYSIS SUMMARY: Hits = 67 Lines analyzed = 13411 in approximately 0.27 seconds (49222 lines/second) Physical Source Lines of Code (SLOC) = 10453 Hits@level = [0] 1 [1] 29 [2] 35 [3] 3 [4] 0 [5] 0 Hits@level+ = [0+] 68 [1+] 67 [2+] 38 [3+] 3 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 6.50531 [1+] 6.40964 [2+] 3.63532 [3+] 0.286999 [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.