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/pyicu-2.5/_icu.cpp Examining data/pyicu-2.5/bases.cpp Examining data/pyicu-2.5/bases.h Examining data/pyicu-2.5/calendar.cpp Examining data/pyicu-2.5/calendar.h Examining data/pyicu-2.5/casemap.cpp Examining data/pyicu-2.5/casemap.h Examining data/pyicu-2.5/char.cpp Examining data/pyicu-2.5/char.h Examining data/pyicu-2.5/charset.cpp Examining data/pyicu-2.5/charset.h Examining data/pyicu-2.5/collator.cpp Examining data/pyicu-2.5/collator.h Examining data/pyicu-2.5/common.cpp Examining data/pyicu-2.5/common.h Examining data/pyicu-2.5/dateformat.cpp Examining data/pyicu-2.5/dateformat.h Examining data/pyicu-2.5/errors.cpp Examining data/pyicu-2.5/errors.h Examining data/pyicu-2.5/format.cpp Examining data/pyicu-2.5/format.h Examining data/pyicu-2.5/gender.cpp Examining data/pyicu-2.5/gender.h Examining data/pyicu-2.5/idna.cpp Examining data/pyicu-2.5/idna.h Examining data/pyicu-2.5/iterators.cpp Examining data/pyicu-2.5/iterators.h Examining data/pyicu-2.5/layoutengine.cpp Examining data/pyicu-2.5/layoutengine.h Examining data/pyicu-2.5/locale.cpp Examining data/pyicu-2.5/locale.h Examining data/pyicu-2.5/macros.h Examining data/pyicu-2.5/measureunit.cpp Examining data/pyicu-2.5/measureunit.h Examining data/pyicu-2.5/normalizer.cpp Examining data/pyicu-2.5/normalizer.h Examining data/pyicu-2.5/numberformat.cpp Examining data/pyicu-2.5/numberformat.h Examining data/pyicu-2.5/regex.cpp Examining data/pyicu-2.5/regex.h Examining data/pyicu-2.5/script.cpp Examining data/pyicu-2.5/script.h Examining data/pyicu-2.5/search.cpp Examining data/pyicu-2.5/search.h Examining data/pyicu-2.5/shape.cpp Examining data/pyicu-2.5/shape.h Examining data/pyicu-2.5/spoof.cpp Examining data/pyicu-2.5/spoof.h Examining data/pyicu-2.5/transliterator.cpp Examining data/pyicu-2.5/transliterator.h Examining data/pyicu-2.5/tries.cpp Examining data/pyicu-2.5/tries.h Examining data/pyicu-2.5/tzinfo.cpp Examining data/pyicu-2.5/tzinfo.h Examining data/pyicu-2.5/unicodeset.cpp Examining data/pyicu-2.5/unicodeset.h FINAL RESULTS: data/pyicu-2.5/_icu.cpp:67:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. } access; data/pyicu-2.5/_icu.cpp:130:25: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. Py_DECREF(self->access.value); data/pyicu-2.5/_icu.cpp:142:15: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. self->access.value = value; data/pyicu-2.5/_icu.cpp:159:15: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. self->access.value = (PyObject *) value; data/pyicu-2.5/_icu.cpp:173:15: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. self->access.get = get; data/pyicu-2.5/_icu.cpp:185:25: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. Py_INCREF(self->access.value); data/pyicu-2.5/_icu.cpp:186:22: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. return self->access.value; data/pyicu-2.5/_icu.cpp:194:18: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. return self->access.get(obj); data/pyicu-2.5/numberformat.cpp:1276:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. NumberingSystem *system; data/pyicu-2.5/numberformat.cpp:1298:65: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. TYPE_CLASSID(NumberingSystem), &locale, &system)) data/pyicu-2.5/numberformat.cpp:1301:27: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. *locale, *system, status)); data/pyicu-2.5/numberformat.cpp:2077:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. NumberingSystem *system; data/pyicu-2.5/numberformat.cpp:2085:37: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return wrap_NumberingSystem(system, T_OWNED); data/pyicu-2.5/numberformat.cpp:2090:41: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return wrap_NumberingSystem(system, T_OWNED); data/pyicu-2.5/numberformat.cpp:2098:41: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return wrap_NumberingSystem(system, T_OWNED); data/pyicu-2.5/numberformat.cpp:2113:26: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. NumberingSystem *system; data/pyicu-2.5/numberformat.cpp:2116:37: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. return wrap_NumberingSystem(system, T_OWNED); data/pyicu-2.5/bases.cpp:567: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 buf[32]; data/pyicu-2.5/bases.cpp:568:9: [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(buf, "0x%llx", (unsigned long long) (intptr_t) self->object); data/pyicu-2.5/bases.cpp:642: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 buf[32]; data/pyicu-2.5/bases.cpp:644:9: [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(buf, "0x%lx", data/pyicu-2.5/bases.cpp:647:9: [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(buf, "0x%llx", data/pyicu-2.5/char.cpp:544: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 buffer[128]; data/pyicu-2.5/char.cpp:890: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 buffer[U_MAX_VERSION_STRING_LENGTH + 1]; data/pyicu-2.5/char.cpp:910: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 buffer[U_MAX_VERSION_STRING_LENGTH + 1]; data/pyicu-2.5/common.cpp:44: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 chars[8]; data/pyicu-2.5/locale.cpp:582:13: [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 code[128]; data/pyicu-2.5/locale.cpp:880: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 buf[ULOC_FULLNAME_CAPACITY]; data/pyicu-2.5/locale.cpp:939: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 maximized[128]; data/pyicu-2.5/locale.cpp:951: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 minimized[128]; data/pyicu-2.5/locale.cpp:1600:18: [2] (misc) open: 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). int fd = open(path, O_RDONLY); data/pyicu-2.5/common.cpp:67:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(stop->chars, chars, len); stop->chars[len] = '\0'; data/pyicu-2.5/common.cpp:929:18: [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 (count != strlen(types)) data/pyicu-2.5/common.cpp:938:24: [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 (count != (int) strlen(types)) data/pyicu-2.5/common.h:379: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). return strlen(str); data/pyicu-2.5/locale.cpp:2046:53: [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 (!parseArgs(args, "nn", &key, &value) && strlen(key.c_str()) == 1) ANALYSIS SUMMARY: Hits = 36 Lines analyzed = 37059 in approximately 0.80 seconds (46130 lines/second) Physical Source Lines of Code (SLOC) = 29449 Hits@level = [0] 0 [1] 5 [2] 14 [3] 0 [4] 17 [5] 0 Hits@level+ = [0+] 36 [1+] 36 [2+] 31 [3+] 17 [4+] 17 [5+] 0 Hits/KSLOC@level+ = [0+] 1.22245 [1+] 1.22245 [2+] 1.05267 [3+] 0.577269 [4+] 0.577269 [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.