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/o3dgc-0~20131011/src/o3dgc_common_lib/src/o3dgcTools.cpp Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/src/o3dgcArithmeticCodec.cpp Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/src/o3dgcTriangleFans.cpp Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcArithmeticCodec.h Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcSC3DMCEncodeParams.h Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcTriangleFans.h Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcAdjacencyInfo.h Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcDynamicVector.h Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcBinaryStream.h Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcIndexedFaceSet.h Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcTimer.h Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcCommon.h Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcDVEncodeParams.h Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcFIFO.h Examining data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcVector.h Examining data/o3dgc-0~20131011/src/o3dgc_decode_lib/src/o3dgcDynamicVectorDecoder.cpp Examining data/o3dgc-0~20131011/src/o3dgc_decode_lib/inc/o3dgcSC3DMCDecoder.h Examining data/o3dgc-0~20131011/src/o3dgc_decode_lib/inc/o3dgcDynamicVectorDecoder.h Examining data/o3dgc-0~20131011/src/o3dgc_decode_lib/inc/o3dgcTriangleListDecoder.h Examining data/o3dgc-0~20131011/src/o3dgc_encode_lib/src/o3dgcDynamicVectorEncoder.cpp Examining data/o3dgc-0~20131011/src/o3dgc_encode_lib/inc/o3dgcDynamicVectorEncoder.h Examining data/o3dgc-0~20131011/src/o3dgc_encode_lib/inc/o3dgcSC3DMCEncoder.h Examining data/o3dgc-0~20131011/src/o3dgc_encode_lib/inc/o3dgcTriangleListEncoder.h Examining data/o3dgc-0~20131011/src/test/src/main.cpp FINAL RESULTS: data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcBinaryStream.h:358:51: [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). FILE * fout = fopen(fileName, "wb"); data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcBinaryStream.h:369:50: [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). FILE * fin = fopen(fileName, "rb"); data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcBinaryStream.h:390:37: [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(m_stream.GetBuffer(), buffer, bufferSize); data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcTriangleFans.h:227:45: [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(m_vertices, tmp, sizeof(long) * m_numVertices); data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcTriangleFans.h:243:45: [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(m_sizeTFAN, tmp, sizeof(long) * m_numTFANs); data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcVector.h:65:45: [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(tmp, m_buffer, m_size * sizeof(T) ); data/o3dgc-0~20131011/src/o3dgc_common_lib/inc/o3dgcVector.h:83:45: [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(tmp, m_buffer, m_size * sizeof(T) ); data/o3dgc-0~20131011/src/o3dgc_common_lib/src/o3dgcTriangleFans.cpp:243:25: [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). g_fileDebugTF = fopen("SaveIntACEGC_new.txt", "w"); data/o3dgc-0~20131011/src/o3dgc_common_lib/src/o3dgcTriangleFans.cpp:442:25: [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). g_fileDebugTF = fopen("Load_new.txt", "w"); data/o3dgc-0~20131011/src/o3dgc_decode_lib/src/o3dgcDynamicVectorDecoder.cpp:156:29: [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). g_fileDebugDVCDec = fopen("dv_dec.txt", "w"); data/o3dgc-0~20131011/src/o3dgc_encode_lib/src/o3dgcDynamicVectorEncoder.cpp:184:28: [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). g_fileDebugDVEnc = fopen("dv_enc.txt", "w"); data/o3dgc-0~20131011/src/test/src/main.cpp:312:19: [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). FILE * fout = fopen(outFileName.c_str(), "wb"); data/o3dgc-0~20131011/src/test/src/main.cpp:382:18: [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). FILE * fin = fopen(fileName.c_str(), "rb"); data/o3dgc-0~20131011/src/test/src/main.cpp:567:19: [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). FILE * fout = fopen(outFileName.c_str(), "wb"); data/o3dgc-0~20131011/src/test/src/main.cpp:609:26: [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). qcoord = atoi(argv[i]); data/o3dgc-0~20131011/src/test/src/main.cpp:617:27: [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). qnormal = atoi(argv[i]); data/o3dgc-0~20131011/src/test/src/main.cpp:625:29: [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). qtexCoord = atoi(argv[i]); data/o3dgc-0~20131011/src/test/src/main.cpp:701:18: [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). FILE * fid = fopen(fileName.c_str(), "r"); data/o3dgc-0~20131011/src/test/src/main.cpp:705: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 buffer[BufferSize]; data/o3dgc-0~20131011/src/test/src/main.cpp:816:38: [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). if (pch) ip[k] = atoi(pch) - 1; data/o3dgc-0~20131011/src/test/src/main.cpp:825:43: [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). if (pch) it[k] = atoi(pch) - 1; data/o3dgc-0~20131011/src/test/src/main.cpp:834:43: [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). if (pch) in[k] = atoi(pch) - 1; data/o3dgc-0~20131011/src/test/src/main.cpp:912: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). fout.open(fileName.c_str()); data/o3dgc-0~20131011/src/test/src/main.cpp:1024: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). fout.open(fileName.c_str()); data/o3dgc-0~20131011/src/test/src/main.cpp:1049:9: [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). fin.open(fileName.c_str()); data/o3dgc-0~20131011/src/test/src/main.cpp:1113: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). fout.open(fileName.c_str()); data/o3dgc-0~20131011/src/test/src/main.cpp:1145:9: [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). fin.open(fileName.c_str()); data/o3dgc-0~20131011/src/o3dgc_common_lib/src/o3dgcArithmeticCodec.cpp:100:7: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). getchar(); data/o3dgc-0~20131011/src/o3dgc_common_lib/src/o3dgcArithmeticCodec.cpp:566:26: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((file_byte = getc(code_file)) == EOF) ANALYSIS SUMMARY: Hits = 29 Lines analyzed = 6380 in approximately 0.18 seconds (35326 lines/second) Physical Source Lines of Code (SLOC) = 5142 Hits@level = [0] 36 [1] 2 [2] 27 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 65 [1+] 29 [2+] 27 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 12.641 [1+] 5.63983 [2+] 5.25088 [3+] 0 [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.