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/ujson-4.0.1/lib/dconv_wrapper.cc Examining data/ujson-4.0.1/lib/ultrajson.h Examining data/ujson-4.0.1/lib/ultrajsondec.c Examining data/ujson-4.0.1/lib/ultrajsonenc.c Examining data/ujson-4.0.1/python/JSONtoObj.c Examining data/ujson-4.0.1/python/objToJSON.c Examining data/ujson-4.0.1/python/ujson.c Examining data/ujson-4.0.1/python/version.h Examining data/ujson-4.0.1/python/version_template.h FINAL RESULTS: data/ujson-4.0.1/lib/ultrajsonenc.c:56: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. #define snprintf sprintf_s data/ujson-4.0.1/lib/ultrajsondec.c:340:7: [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(ds->escStart, oldStart, escLen * sizeof(wchar_t)); data/ujson-4.0.1/lib/ultrajsondec.c:751:3: [2] (buffer) wchar_t: 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. wchar_t escBuffer[(JSON_MAX_STACK_BUFFER_SIZE / sizeof(wchar_t))]; data/ujson-4.0.1/lib/ultrajsonenc.c:145: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 (enc->start, oldStart, offset); data/ujson-4.0.1/lib/ultrajsonenc.c:312: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(&in16, io, sizeof(JSUTF16)); data/ujson-4.0.1/lib/ultrajsonenc.c:345: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(&in16, io, sizeof(JSUTF16)); data/ujson-4.0.1/lib/ultrajsonenc.c:346: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(&in8, io + 2, sizeof(JSUINT8)); data/ujson-4.0.1/lib/ultrajsonenc.c:378: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(&in, io, sizeof(JSUTF32)); data/ujson-4.0.1/lib/ultrajsonenc.c:571: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[128]; data/ujson-4.0.1/lib/ultrajsonenc.c:579:3: [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(enc->offset, buf, strlength); data/ujson-4.0.1/lib/ultrajsonenc.c:851:7: [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(enc->offset, value, szlen); data/ujson-4.0.1/python/objToJSON.c:743: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 buffer[65536]; data/ujson-4.0.1/python/JSONtoObj.c:204:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). PyObject *read; data/ujson-4.0.1/python/JSONtoObj.c:223:26: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (!PyCallable_Check (read)) { data/ujson-4.0.1/python/JSONtoObj.c:224:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Py_XDECREF(read); data/ujson-4.0.1/python/JSONtoObj.c:229:33: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). string = PyObject_CallObject (read, NULL); data/ujson-4.0.1/python/JSONtoObj.c:230:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Py_XDECREF(read); ANALYSIS SUMMARY: Hits = 17 Lines analyzed = 3582 in approximately 0.13 seconds (28369 lines/second) Physical Source Lines of Code (SLOC) = 2636 Hits@level = [0] 0 [1] 5 [2] 11 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 17 [1+] 17 [2+] 12 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 6.44917 [1+] 6.44917 [2+] 4.55235 [3+] 0.379363 [4+] 0.379363 [5+] 0 Dot directories skipped = 2 (--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.