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/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_xv.h Examining data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_xv.c Examining data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_compat.h Examining data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv.h Examining data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c Examining data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv.c Examining data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.h FINAL RESULTS: data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:236:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(yuvDevFull, "%s%d", yuvDev, yuvId); data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:240:6: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(yuvDevFull1, "%s%d", yuvDev, yuvId - 48); data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:184:8: [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. dev = getenv("FRAMEBUFFER"); data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv.c:473:5: [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(devPtr->Options, IVTVDevOptions, sizeof(IVTVDevOptions)); data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:181:7: [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). fd = open(dev, O_RDWR, 0); data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:185:30: [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 ((NULL == dev) || ((fd = open(dev, O_RDWR, 0)) == -1)) { data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:188:11: [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). fd = open(dev, O_RDWR, 0); data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:230: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 yuvDev[20] = "/dev/video"; data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:231: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 yuvDevFull[20]; data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:232: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 yuvDevFull1[20]; data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:237: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). yuvFd = open(yuvDevFull, O_RDONLY); data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:241: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). yuvFd = open(yuvDevFull1, O_RDONLY); data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:511: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(this, mode, sizeof(DisplayModeRec)); data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:516: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(this, mode, sizeof(DisplayModeRec)); data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_xv.c:148: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(newAdaptors, adaptors, num_adaptors * data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_xv.c:581: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(dst_2, src + src_x + x + (y + i) * width + (src_y * width), w_size); data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_xv.c:918:24: [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 ((devPtr->fd_yuv = open(devPtr->yuvDevName, O_RDWR)) == -1) { data/xserver-xorg-video-ivtvdev-1.1.2/src/ivtv_hw.c:208:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*namep, fix.id, 16); ANALYSIS SUMMARY: Hits = 18 Lines analyzed = 3121 in approximately 0.16 seconds (19050 lines/second) Physical Source Lines of Code (SLOC) = 2336 Hits@level = [0] 1 [1] 1 [2] 14 [3] 1 [4] 2 [5] 0 Hits@level+ = [0+] 19 [1+] 18 [2+] 17 [3+] 3 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 8.13356 [1+] 7.70548 [2+] 7.2774 [3+] 1.28425 [4+] 0.856164 [5+] 0 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.