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/v4l2loopback-0.12.5/doc/missingformats.h
Examining data/v4l2loopback-0.12.5/examples/ondemandcam.c
Examining data/v4l2loopback-0.12.5/examples/test.c
Examining data/v4l2loopback-0.12.5/examples/yuv420_infiniteloop.c
Examining data/v4l2loopback-0.12.5/examples/yuv4mpeg_to_v4l2.c
Examining data/v4l2loopback-0.12.5/tests/test_dqbuf.c
Examining data/v4l2loopback-0.12.5/v4l2loopback.c
Examining data/v4l2loopback-0.12.5/v4l2loopback_formats.h

FINAL RESULTS:

data/v4l2loopback-0.12.5/examples/yuv4mpeg_to_v4l2.c:76:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(msg, "malformed %s header", kind);
data/v4l2loopback-0.12.5/v4l2loopback.c:494:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	return sprintf(buf, "%4s:%dx%d@%s\n",
data/v4l2loopback-0.12.5/v4l2loopback.c:660:3:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
		snprintf(buf, len, card_label[nr]);
data/v4l2loopback-0.12.5/v4l2loopback.c:1156:2:  [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(q->name, cnf->name);
data/v4l2loopback-0.12.5/examples/ondemandcam.c:48: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( vidsendbuf+3, vidsendbuf, vidsendsiz-3 );
data/v4l2loopback-0.12.5/examples/ondemandcam.c:57:16:  [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).
    v4l2sink = open(v4l2dev, O_WRONLY);
data/v4l2loopback-0.12.5/examples/test.c:117: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).
	fdwr = open(video_device, O_RDWR);
data/v4l2loopback-0.12.5/examples/test.c:170: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).
	int fdr = open(video_device, O_RDONLY);
data/v4l2loopback-0.12.5/examples/yuv420_infiniteloop.c:49:23:  [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).
		setup.frame_width = atoi(argv[3]);
data/v4l2loopback-0.12.5/examples/yuv420_infiniteloop.c:50:24:  [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).
		setup.frame_height = atoi(argv[4]);
data/v4l2loopback-0.12.5/examples/yuv420_infiniteloop.c:61:20:  [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 * yuv_file = fopen (setup.file_name,"rb");
data/v4l2loopback-0.12.5/examples/yuv420_infiniteloop.c:79:15:  [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).
			yuv_file = fopen (setup.file_name,"rb");
data/v4l2loopback-0.12.5/examples/yuv420_infiniteloop.c:94:15:  [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).
	int dev_fd = open(setup.device, O_RDWR);
data/v4l2loopback-0.12.5/examples/yuv4mpeg_to_v4l2.c:74: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 msg[64];
data/v4l2loopback-0.12.5/examples/yuv4mpeg_to_v4l2.c:165: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).
	dev_fd = open(device, O_RDWR);
data/v4l2loopback-0.12.5/tests/test_dqbuf.c:42:8:  [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 (argv[1], O_RDWR);
data/v4l2loopback-0.12.5/v4l2loopback.c:119: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 name[V4L2_DEVICE_NAME_SIZE];
data/v4l2loopback-0.12.5/v4l2loopback.c:209:8:  [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 char *card_label[MAX_DEVICES];
data/v4l2loopback-0.12.5/v4l2loopback.c:411:8:  [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 char *fourcc2str(unsigned int fourcc, char buf[4])
data/v4l2loopback-0.12.5/v4l2loopback.c:411:46:  [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 char *fourcc2str(unsigned int fourcc, char buf[4])
data/v4l2loopback-0.12.5/v4l2loopback.c:481: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 buf4cc[5], buf_fps[32];
data/v4l2loopback-0.12.5/v4l2loopback.c:525:9:  [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.
	return sprintf(buf, "%d\n", dev->used_buffers);
data/v4l2loopback-0.12.5/v4l2loopback.c:535:9:  [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.
	return sprintf(buf, "%d\n", dev->max_openers);
data/v4l2loopback-0.12.5/v4l2loopback.c:833: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 buf[5];
data/v4l2loopback-0.12.5/v4l2loopback.c:993: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 buf[5];
data/v4l2loopback-0.12.5/v4l2loopback.c:1587: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(dev->image + dev->buffers[ret].buffer.m.offset,
data/v4l2loopback-0.12.5/examples/test.c:171:2:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	read(fdr, check_buffer, framesize);
data/v4l2loopback-0.12.5/examples/yuv420_infiniteloop.c:74:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
		usleep(1.0f/setup.fps * 1000000.0f);

ANALYSIS SUMMARY:

Hits = 28
Lines analyzed = 3947 in approximately 0.10 seconds (38594 lines/second)
Physical Source Lines of Code (SLOC) = 3105
Hits@level = [0]  33 [1]   2 [2]  22 [3]   0 [4]   4 [5]   0
Hits@level+ = [0+]  61 [1+]  28 [2+]  26 [3+]   4 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 19.6457 [1+] 9.01771 [2+] 8.37359 [3+] 1.28824 [4+] 1.28824 [5+]   0
Dot directories skipped = 2 (--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.