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/vdr-plugin-vcd-0.9/menucontrol.h Examining data/vdr-plugin-vcd-0.9/functions.c Examining data/vdr-plugin-vcd-0.9/menu.h Examining data/vdr-plugin-vcd-0.9/psd.h Examining data/vdr-plugin-vcd-0.9/viewer.c Examining data/vdr-plugin-vcd-0.9/setup.h Examining data/vdr-plugin-vcd-0.9/functions.h Examining data/vdr-plugin-vcd-0.9/psdcontrol.h Examining data/vdr-plugin-vcd-0.9/viewer.h Examining data/vdr-plugin-vcd-0.9/player.h Examining data/vdr-plugin-vcd-0.9/menu.c Examining data/vdr-plugin-vcd-0.9/menucontrol.c Examining data/vdr-plugin-vcd-0.9/psd.c Examining data/vdr-plugin-vcd-0.9/psdcontrol.c Examining data/vdr-plugin-vcd-0.9/setup.c Examining data/vdr-plugin-vcd-0.9/vcd.c Examining data/vdr-plugin-vcd-0.9/player.c FINAL RESULTS: data/vdr-plugin-vcd-0.9/functions.c:96:10: [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 access(deviceName, F_OK) == 0; data/vdr-plugin-vcd-0.9/menucontrol.c:269:3: [4] (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). strcpy(buf, tr("Jump: ")); data/vdr-plugin-vcd-0.9/vcd.c:92:15: [3] (buffer) getopt_long: 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 ((c = getopt_long(argc, argv, "v:", long_options, NULL)) != -1) { data/vdr-plugin-vcd-0.9/functions.c:87:12: [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). if ((f = open(deviceName, O_RDONLY | O_NONBLOCK)) > 0) { data/vdr-plugin-vcd-0.9/functions.c:114:14: [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). cdrom = open(deviceName, O_RDONLY | O_NONBLOCK); data/vdr-plugin-vcd-0.9/functions.c:166:3: [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(sect, &msf0, sizeof(struct cdrom_msf0)); data/vdr-plugin-vcd-0.9/functions.c:177:3: [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(data, sect.data, sizeof(sect.data)); data/vdr-plugin-vcd-0.9/functions.h:125: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 system_id[8]; data/vdr-plugin-vcd-0.9/functions.h:128: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 album_id[16]; data/vdr-plugin-vcd-0.9/functions.h:143: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 file_id[8]; data/vdr-plugin-vcd-0.9/menu.h:36: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 vcdTitle[17]; data/vdr-plugin-vcd-0.9/menucontrol.c:268: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 buf[64]; data/vdr-plugin-vcd-0.9/menucontrol.c:279:3: [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 + len, "%c%c:%c%c", ch10, ch1, cm10, cm1); data/vdr-plugin-vcd-0.9/player.c:627:6: [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(buffer, buffer+ofs, count-ofs); data/vdr-plugin-vcd-0.9/player.c:644:27: [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(seqhdr_buf, buffer+i, seqhdr_size); data/vdr-plugin-vcd-0.9/player.c:696:12: [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_buf, buffer+insert_seqhdr, count-ofs-insert_seqhdr); data/vdr-plugin-vcd-0.9/player.c:697:12: [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(buffer+insert_seqhdr, seqhdr_buf, seqhdr_size); data/vdr-plugin-vcd-0.9/player.c:698:12: [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(buffer+insert_seqhdr+seqhdr_size, tmp_buf, count-ofs-insert_seqhdr); data/vdr-plugin-vcd-0.9/player.c:796:15: [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(buf, &(sector.data[0]), CD_XA22_DATASIZE); data/vdr-plugin-vcd-0.9/vcd.c:193: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). VcdSetupData.DriveSpeed = atoi(Value); data/vdr-plugin-vcd-0.9/vcd.c:195: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). VcdSetupData.BrokenMode = atoi(Value); data/vdr-plugin-vcd-0.9/vcd.c:197:39: [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). VcdSetupData.HideMainMenuEntry = atoi(Value); data/vdr-plugin-vcd-0.9/vcd.c:199:44: [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). VcdSetupData.PlayTracksContinuously = atoi(Value); data/vdr-plugin-vcd-0.9/vcd.c:201:37: [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). VcdSetupData.AutostartReplay = atoi(Value); data/vdr-plugin-vcd-0.9/vcd.c:203:40: [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). VcdSetupData.PlaySequenceReplay = atoi(Value); data/vdr-plugin-vcd-0.9/viewer.c:193: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). if ((fp = fopen("/tmp/item.mpg", "w")) != NULL) { data/vdr-plugin-vcd-0.9/viewer.c:306:12: [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(buffer+count, tmpbuf+ofs, len); data/vdr-plugin-vcd-0.9/viewer.c:309:12: [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(buffer+count, tmpbuf+ofs, tmpcnt-ofs); data/vdr-plugin-vcd-0.9/viewer.c:314:12: [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(buffer+count, tmpbuf+ofs, tmpcnt-ofs); data/vdr-plugin-vcd-0.9/viewer.c:359:27: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. case 0x64: memcpy(buf, &(sector.data[0]), CD_XA22_DATASIZE); data/vdr-plugin-vcd-0.9/menu.c:49:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(vcdTitle,vcd->vcdInfo.album_id,16); data/vdr-plugin-vcd-0.9/menucontrol.c:270:13: [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). int len = strlen(buf); ANALYSIS SUMMARY: Hits = 32 Lines analyzed = 3829 in approximately 0.10 seconds (39022 lines/second) Physical Source Lines of Code (SLOC) = 3018 Hits@level = [0] 0 [1] 2 [2] 27 [3] 1 [4] 2 [5] 0 Hits@level+ = [0+] 32 [1+] 32 [2+] 30 [3+] 3 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 10.603 [1+] 10.603 [2+] 9.94036 [3+] 0.994036 [4+] 0.662691 [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.