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/bsdiff-4.3/bspatch.c
Examining data/bsdiff-4.3/bsdiff.c

FINAL RESULTS:

data/bsdiff-4.3/bsdiff.c:232: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(argv[1], O_RDONLY,0);
data/bsdiff-4.3/bsdiff.c:256: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(argv[2], O_RDONLY, 0);
data/bsdiff-4.3/bsdiff.c:276:12:  [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 ((pf = fopen(argv[3], "w")) == NULL)
data/bsdiff-4.3/bsdiff.c:289:2:  [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(header,"BSDIFF40",8);
data/bsdiff-4.3/bspatch.c:75:11:  [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 ((f = fopen(argv[3], "r")) == NULL)
data/bsdiff-4.3/bspatch.c:113:13:  [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 ((cpf = fopen(argv[3], "r")) == NULL)
data/bsdiff-4.3/bspatch.c:120:13:  [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 ((dpf = fopen(argv[3], "r")) == NULL)
data/bsdiff-4.3/bspatch.c:127:13:  [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 ((epf = fopen(argv[3], "r")) == NULL)
data/bsdiff-4.3/bspatch.c:135: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).
	if(((fd=open(argv[1],O_RDONLY,0))<0) ||
data/bsdiff-4.3/bspatch.c:200: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).
	if(((fd=open(argv[2],O_CREAT|O_TRUNC|O_WRONLY,0666))<0) ||
data/bsdiff-4.3/bspatch.c:139:4:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		(read(fd,old,oldsize)!=oldsize) ||

ANALYSIS SUMMARY:

Hits = 11
Lines analyzed = 639 in approximately 0.04 seconds (14756 lines/second)
Physical Source Lines of Code (SLOC) = 444
Hits@level = [0]   1 [1]   1 [2]  10 [3]   0 [4]   0 [5]   0
Hits@level+ = [0+]  12 [1+]  11 [2+]  10 [3+]   0 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 27.027 [1+] 24.7748 [2+] 22.5225 [3+]   0 [4+]   0 [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.