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/vgabios-0.7b+ds/vgatables.h Examining data/vgabios-0.7b+ds/biossums.c Examining data/vgabios-0.7b+ds/vgafonts.h Examining data/vgabios-0.7b+ds/vbetables.h Examining data/vgabios-0.7b+ds/tests/testbios.c Examining data/vgabios-0.7b+ds/tests/lfbprof/lfbprof.h Examining data/vgabios-0.7b+ds/tests/lfbprof/lfbprof.c Examining data/vgabios-0.7b+ds/clext.c Examining data/vgabios-0.7b+ds/vgabios.h Examining data/vgabios-0.7b+ds/vgabios.c Examining data/vgabios-0.7b+ds/vbe.c Examining data/vgabios-0.7b+ds/vbe.h Examining data/vgabios-0.7b+ds/vbetables-gen.c FINAL RESULTS: data/vgabios-0.7b+ds/vgabios.c:71:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. static void printf(); data/vgabios-0.7b+ds/vgabios.c:412: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. ;; We have to set ds to access the right data segment data/vgabios-0.7b+ds/vgabios.c:433:40: [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. ;; switch to color mode and enable CPU access 480 lines data/vgabios-0.7b+ds/vgabios.c:3862:6: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. void printf(s) data/vgabios-0.7b+ds/biossums.c:67:17: [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 ((stream = fopen(argv[1], "rb")) == NULL) { data/vgabios-0.7b+ds/biossums.c:164: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). if ((stream = fopen( argv[1], "wb")) == NULL) { data/vgabios-0.7b+ds/tests/lfbprof/lfbprof.c:587:18: [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). InitGraphics(atoi(argv[1]),atoi(argv[2])); /* Start graphics */ data/vgabios-0.7b+ds/tests/lfbprof/lfbprof.c:587:32: [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). InitGraphics(atoi(argv[1]),atoi(argv[2])); /* Start graphics */ data/vgabios-0.7b+ds/tests/lfbprof/lfbprof.h:24: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 VESASignature[4]; /* 'VESA' 4 byte signature */ data/vgabios-0.7b+ds/tests/lfbprof/lfbprof.h:37: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 reserved[222]; /* Pad to 256 byte block size */ data/vgabios-0.7b+ds/tests/lfbprof/lfbprof.h:38: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 OemDATA[256]; /* Scratch pad for OEM data */ data/vgabios-0.7b+ds/tests/lfbprof/lfbprof.h:79: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 res2[206]; /* Pad to 256 byte block size */ data/vgabios-0.7b+ds/tests/testbios.c:133:11: [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 table[64]; data/vgabios-0.7b+ds/tests/testbios.c:154: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 var[64]; data/vgabios-0.7b+ds/tests/lfbprof/lfbprof.c:358:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(vgaInfo.VESASignature,"VBE2",4); data/vgabios-0.7b+ds/vgabios.c:3962:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ; read PCI register ANALYSIS SUMMARY: Hits = 16 Lines analyzed = 14307 in approximately 0.40 seconds (36121 lines/second) Physical Source Lines of Code (SLOC) = 12396 Hits@level = [0] 169 [1] 2 [2] 10 [3] 0 [4] 4 [5] 0 Hits@level+ = [0+] 185 [1+] 16 [2+] 14 [3+] 4 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 14.9242 [1+] 1.29074 [2+] 1.1294 [3+] 0.322685 [4+] 0.322685 [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.