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/os-autoinst-4.5.1527308405.8b586d5/debugviewer/debugviewer.cpp Examining data/os-autoinst-4.5.1527308405.8b586d5/ppmclibs/tinycv.h Examining data/os-autoinst-4.5.1527308405.8b586d5/ppmclibs/tinycv_ast2100.cc Examining data/os-autoinst-4.5.1527308405.8b586d5/ppmclibs/tinycv_impl.cc Examining data/os-autoinst-4.5.1527308405.8b586d5/snd2png/snd2png.cpp Examining data/os-autoinst-4.5.1527308405.8b586d5/videoencoder.cpp FINAL RESULTS: data/os-autoinst-4.5.1527308405.8b586d5/videoencoder.cpp:155:32: [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. bool need_last_png() { return !access("live_log", R_OK); } data/os-autoinst-4.5.1527308405.8b586d5/videoencoder.cpp:164:19: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((opt = getopt(argc, argv, "n")) != -1) { data/os-autoinst-4.5.1527308405.8b586d5/videoencoder.cpp:193:5: [3] (random) srand: 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. srand(time(NULL)); data/os-autoinst-4.5.1527308405.8b586d5/ppmclibs/tinycv_ast2100.cc:27:14: [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. unsigned char vals[256]; data/os-autoinst-4.5.1527308405.8b586d5/ppmclibs/tinycv_ast2100.cc:159:17: [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 unsigned char zig2[64] = { data/os-autoinst-4.5.1527308405.8b586d5/ppmclibs/tinycv_ast2100.cc:230:17: [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 unsigned char zig[64] = { data/os-autoinst-4.5.1527308405.8b586d5/ppmclibs/tinycv_ast2100.cc:290:17: [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 unsigned char quant_y[64] = { data/os-autoinst-4.5.1527308405.8b586d5/ppmclibs/tinycv_ast2100.cc:300:17: [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 unsigned char quant_uv[64] = { data/os-autoinst-4.5.1527308405.8b586d5/ppmclibs/tinycv_ast2100.cc:342:14: [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. unsigned char lookup[4]; data/os-autoinst-4.5.1527308405.8b586d5/ppmclibs/tinycv_impl.cc:107: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 f[200]; data/os-autoinst-4.5.1527308405.8b586d5/ppmclibs/tinycv_impl.cc:108:5: [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(f, "debug-%lf-scene.png", mse); data/os-autoinst-4.5.1527308405.8b586d5/ppmclibs/tinycv_impl.cc:110:5: [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(f, "debug-%lf-object.png", mse); data/os-autoinst-4.5.1527308405.8b586d5/ppmclibs/tinycv_impl.cc:115:5: [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(f, "debug-%lf-diff.png", mse); data/os-autoinst-4.5.1527308405.8b586d5/videoencoder.cpp:185: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). ogg_fp = fopen(option_output, "wb"); data/os-autoinst-4.5.1527308405.8b586d5/videoencoder.cpp:302: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 line[PATH_MAX + 10]; data/os-autoinst-4.5.1527308405.8b586d5/videoencoder.cpp:369: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 path[PATH_MAX]; data/os-autoinst-4.5.1527308405.8b586d5/videoencoder.cpp:370:13: [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(path, "qemuscreenshot/%ld.%ld.png", tv.tv_sec, tv.tv_usec); data/os-autoinst-4.5.1527308405.8b586d5/videoencoder.cpp:311: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). line[strlen(line) - 1] = 0; ANALYSIS SUMMARY: Hits = 18 Lines analyzed = 1988 in approximately 0.09 seconds (21302 lines/second) Physical Source Lines of Code (SLOC) = 1532 Hits@level = [0] 34 [1] 1 [2] 14 [3] 2 [4] 1 [5] 0 Hits@level+ = [0+] 52 [1+] 18 [2+] 17 [3+] 3 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 33.9426 [1+] 11.7493 [2+] 11.0966 [3+] 1.95822 [4+] 0.652742 [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.