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/ucimf-openvanilla-2.10.11/src/ovimf.cpp Examining data/ucimf-openvanilla-2.10.11/src/debug.h Examining data/ucimf-openvanilla-2.10.11/src/openvanilla.cpp Examining data/ucimf-openvanilla-2.10.11/src/openvanilla.h Examining data/ucimf-openvanilla-2.10.11/include/OpenVanilla/OVLibrary.h Examining data/ucimf-openvanilla-2.10.11/include/OpenVanilla/OVUtility.h Examining data/ucimf-openvanilla-2.10.11/include/OpenVanilla/OpenVanilla.h FINAL RESULTS: data/ucimf-openvanilla-2.10.11/include/OpenVanilla/OVUtility.h:104:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(OV_USERDIR_PRE, "%s\\%s", OV_USERDIR_PRE, "OpenVanilla\\"); data/ucimf-openvanilla-2.10.11/include/OpenVanilla/OVUtility.h:108:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(OV_USERDIR_PRE, "%s\\%s", OV_BASEDIR_PRE, "User\\"); data/ucimf-openvanilla-2.10.11/include/OpenVanilla/OVUtility.h:111:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(OV_WIN32_DEBUG_LOG_PATH, "%s\\%s", OV_USERDIR_PRE, "orz.txt"); data/ucimf-openvanilla-2.10.11/include/OpenVanilla/OVUtility.h:118:4: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (fp, format, args); data/ucimf-openvanilla-2.10.11/include/OpenVanilla/OVUtility.h:126:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf (stderr, format, args); data/ucimf-openvanilla-2.10.11/src/openvanilla.cpp:165:30: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const string path = string( getenv("HOME") ) + string( "/.openvanilla/" )+string( modid ); data/ucimf-openvanilla-2.10.11/src/ovimf.cpp:63:40: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. snprintf(name, sizeof(name), "%s/%s", getenv("HOME"), ".ucimf-log"); data/ucimf-openvanilla-2.10.11/src/ovimf.cpp:101:50: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. snprintf( user_dir, sizeof(user_dir), "%s/%s", getenv("HOME"), ".openvanilla/OVIMGeneric/"); data/ucimf-openvanilla-2.10.11/include/OpenVanilla/OVUtility.h:91: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 OV_BASEDIR_PRE[MAX_PATH]; data/ucimf-openvanilla-2.10.11/include/OpenVanilla/OVUtility.h:92: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 OV_USERDIR_PRE[MAX_PATH]; data/ucimf-openvanilla-2.10.11/include/OpenVanilla/OVUtility.h:96:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(OV_BASEDIR_PRE, "C:\\OpenVanilla\\"); data/ucimf-openvanilla-2.10.11/include/OpenVanilla/OVUtility.h:110: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 OV_WIN32_DEBUG_LOG_PATH[MAX_PATH]; data/ucimf-openvanilla-2.10.11/include/OpenVanilla/OVUtility.h:115:10: [2] (misc) fopen: 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). if (fp=fopen(OV_WIN32_DEBUG_LOG_PATH, "a")) { data/ucimf-openvanilla-2.10.11/src/openvanilla.cpp:278: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(_dict[key].c_str()); data/ucimf-openvanilla-2.10.11/src/openvanilla.h:87: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[512]; data/ucimf-openvanilla-2.10.11/src/openvanilla.h:104: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 internal[1024]; data/ucimf-openvanilla-2.10.11/src/ovimf.cpp:62:2: [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 name[64]; data/ucimf-openvanilla-2.10.11/src/ovimf.cpp:66:10: [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). LogFd = open(name, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR); data/ucimf-openvanilla-2.10.11/src/ovimf.cpp:100: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 user_dir[64]; data/ucimf-openvanilla-2.10.11/src/openvanilla.cpp:174:14: [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). in_bytes = strlen(src)+1; data/ucimf-openvanilla-2.10.11/src/openvanilla.cpp:188:14: [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). in_bytes = strlen(src)+1; ANALYSIS SUMMARY: Hits = 21 Lines analyzed = 1307 in approximately 0.04 seconds (30618 lines/second) Physical Source Lines of Code (SLOC) = 918 Hits@level = [0] 5 [1] 2 [2] 11 [3] 3 [4] 5 [5] 0 Hits@level+ = [0+] 26 [1+] 21 [2+] 19 [3+] 8 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 28.3224 [1+] 22.8758 [2+] 20.6972 [3+] 8.7146 [4+] 5.44662 [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.