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/xdelta-1.1.3/xdelta.c
Examining data/xdelta-1.1.3/xdapply.c
Examining data/xdelta-1.1.3/xd_edsio.c
Examining data/xdelta-1.1.3/getopt.c
Examining data/xdelta-1.1.3/getopt1.c
Examining data/xdelta-1.1.3/xdelta.h
Examining data/xdelta-1.1.3/xd_edsio.h
Examining data/xdelta-1.1.3/xdeltapriv.h
Examining data/xdelta-1.1.3/getopt.h
Examining data/xdelta-1.1.3/xdrsync.c
Examining data/xdelta-1.1.3/libedsio/library.c
Examining data/xdelta-1.1.3/libedsio/simple.c
Examining data/xdelta-1.1.3/libedsio/edsio_edsio.c
Examining data/xdelta-1.1.3/libedsio/sha.c
Examining data/xdelta-1.1.3/libedsio/md5c.c
Examining data/xdelta-1.1.3/libedsio/generic.c
Examining data/xdelta-1.1.3/libedsio/default.c
Examining data/xdelta-1.1.3/libedsio/base64.c
Examining data/xdelta-1.1.3/libedsio/maketime.c
Examining data/xdelta-1.1.3/libedsio/partime.c
Examining data/xdelta-1.1.3/libedsio/edsiotest.c
Examining data/xdelta-1.1.3/libedsio/edsio_edsio.h
Examining data/xdelta-1.1.3/libedsio/maketime.h
Examining data/xdelta-1.1.3/libedsio/partime.h
Examining data/xdelta-1.1.3/libedsio/edsio.c
Examining data/xdelta-1.1.3/libedsio/edsio.h
Examining data/xdelta-1.1.3/libedsio/fh.c
Examining data/xdelta-1.1.3/test/xdeltatest.c
Examining data/xdelta-1.1.3/xdmain.c

FINAL RESULTS:

data/xdelta-1.1.3/test/xdeltatest.c:237:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  sprintf (file->name, "%s.%d.%d", TEST_PREFIX, getpid (), count++);
data/xdelta-1.1.3/test/xdeltatest.c:387:7:  [4] (shell) execl:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      execl (tp->progname,
data/xdelta-1.1.3/test/xdeltatest.c:445:4:  [4] (shell) execl:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	  execl (tp->progname,
data/xdelta-1.1.3/test/xdeltatest.c:474:6:  [4] (shell) execl:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	    execl (tp->progname,
data/xdelta-1.1.3/test/xdeltatest.c:482:6:  [4] (shell) execl:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
	    execl (tp->progname,
data/xdelta-1.1.3/test/xdeltatest.c:670:3:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  system ("rm -rf " TEST_PREFIX "*");
data/xdelta-1.1.3/test/xdeltatest.c:681:7:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      system ("rm -rf " TEST_PREFIX "*");
data/xdelta-1.1.3/getopt.c:171:7:  [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.
char *getenv ();
data/xdelta-1.1.3/getopt.c:289:21:  [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.
  posixly_correct = getenv ("POSIXLY_CORRECT");
data/xdelta-1.1.3/getopt.c:666:1:  [3] (buffer) getopt:
  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.
getopt (argc, argv, optstring)
data/xdelta-1.1.3/getopt.c:696:11:  [3] (buffer) getopt:
  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.
      c = getopt (argc, argv, "abc:d:0123456789");
data/xdelta-1.1.3/getopt.h:102:12:  [3] (buffer) getopt:
  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.
extern int getopt (int argc, char *const *argv, const char *shortopts);
data/xdelta-1.1.3/getopt.h:104:12:  [3] (buffer) getopt:
  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.
extern int getopt ();
data/xdelta-1.1.3/getopt.h:106:12:  [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.
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
data/xdelta-1.1.3/getopt.h:118:12:  [3] (buffer) getopt:
  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.
extern int getopt ();
data/xdelta-1.1.3/getopt.h:119:12:  [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.
extern int getopt_long ();
data/xdelta-1.1.3/getopt1.c:51:7:  [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.
char *getenv ();
data/xdelta-1.1.3/getopt1.c:59:1:  [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.
getopt_long (argc, argv, options, long_options, opt_index)
data/xdelta-1.1.3/getopt1.c:115:11:  [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.
      c = getopt_long (argc, argv, "abc:d:0123456789",
data/xdelta-1.1.3/libedsio/maketime.c:108:21:  [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.
  if (!TZ && !(TZ = getenv ("TZ")))
data/xdelta-1.1.3/test/xdeltatest.c:195:10:  [3] (random) lrand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  return lrand48 () % (data_source_length - len);
data/xdelta-1.1.3/test/xdeltatest.c:374:36:  [3] (random) lrand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  return perform_change_rec (inst, lrand48() % ((* len) - cmd_deletion_length), len);
data/xdelta-1.1.3/test/xdeltatest.c:579:3:  [3] (random) seed48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  seed48 (cmd_seed);
data/xdelta-1.1.3/xdmain.c:378: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,
data/xdelta-1.1.3/xdmain.c:599:24:  [3] (buffer) g_get_tmp_dir:
  This function is synonymous with 'getenv("TMP")';it returns untrustable
  input if the environment can beset by an attacker. It 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.
  const char* tmpdir = g_get_tmp_dir ();
data/xdelta-1.1.3/libedsio/base64.c:15:23:  [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 const unsigned char base64_table[64] = {
data/xdelta-1.1.3/libedsio/edsio.c:332:10:  [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 timebuf[64];
data/xdelta-1.1.3/libedsio/edsio.c:341: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(timebuf,
data/xdelta-1.1.3/libedsio/edsio.c:516: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[100];
data/xdelta-1.1.3/libedsio/edsio.c:523:5:  [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 + 2*i, "%02x", bytes[i]);
data/xdelta-1.1.3/libedsio/edsio.c:526:5:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
    strcat (buf, "...");
data/xdelta-1.1.3/libedsio/edsio.c:532:41:  [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.
edsio_md5_to_string (const guint8* md5, char buf[33])
data/xdelta-1.1.3/libedsio/edsio.c:537:5:  [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 + 2*i, "%02x", md5[i]);
data/xdelta-1.1.3/libedsio/edsio.c:543: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[2];
data/xdelta-1.1.3/libedsio/edsio.c:569:43:  [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.
edsio_md5_from_string (guint8* md5, const char buf[33])
data/xdelta-1.1.3/libedsio/edsio.h:332:53:  [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.
void      edsio_md5_to_string   (const guint8* md5, char buf[33]);
data/xdelta-1.1.3/libedsio/edsio.h:333:59:  [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.
gboolean  edsio_md5_from_string (guint8* md5,       const char buf[33]);
data/xdelta-1.1.3/libedsio/edsiotest.c:183: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 md5str2[33];
data/xdelta-1.1.3/libedsio/maketime.c:382:33:  [2] (integer) atol:
  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).
  long default_zone = argv[1] ? atol (argv[1]) : 0;
data/xdelta-1.1.3/libedsio/maketime.c:383: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[1000];
data/xdelta-1.1.3/libedsio/md5c.c:53:20:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define MD5_memcpy memcpy
data/xdelta-1.1.3/libedsio/md5c.c:56: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 PADDING[64] = {
data/xdelta-1.1.3/libedsio/md5c.c:155:14:  [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 bits[8];
data/xdelta-1.1.3/libedsio/partime.c:80: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 name[NAME_LENGTH_MAXIMUM];
data/xdelta-1.1.3/libedsio/partime.c:190: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[NAME_LENGTH_MAXIMUM];
data/xdelta-1.1.3/libedsio/sha.c:191:9:  [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(((guint8 *) ctx->data) + ctx->local, buffer, i);
data/xdelta-1.1.3/libedsio/sha.c:203:9:  [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(ctx->data, buffer, SHA_BLOCKSIZE);
data/xdelta-1.1.3/libedsio/sha.c:209: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(ctx->data, buffer, count);
data/xdelta-1.1.3/libedsio/sha.c:238: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 (digest, ctx->digest, 20);
data/xdelta-1.1.3/libedsio/simple.c:78: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 (buf, ssource->in_data + ssource->read_pos, len);
data/xdelta-1.1.3/test/xdeltatest.c:95: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 name[MAXPATHLEN];
data/xdelta-1.1.3/test/xdeltatest.c:160: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  slevel_str[16];
data/xdelta-1.1.3/test/xdeltatest.c:164:7:  [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 (slevel_str, "%d", slevel);
data/xdelta-1.1.3/test/xdeltatest.c:214:14:  [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  *f = fopen (file->name, "r");
data/xdelta-1.1.3/test/xdeltatest.c:252: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).
  toh   = fopen (tofile->name, "r");
data/xdelta-1.1.3/test/xdeltatest.c:253: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).
  fromh = fopen (fromfile->name, "r");
data/xdelta-1.1.3/test/xdeltatest.c:294:14:  [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 (! (h = fopen (file->name, "w"))) {
data/xdelta-1.1.3/test/xdeltatest.c:382:14:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
  if ((pid = vfork()) < 0)
data/xdelta-1.1.3/test/xdeltatest.c:422: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 xdelta_args[16];
data/xdelta-1.1.3/test/xdeltatest.c:423: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 xdelta_args2[16];
data/xdelta-1.1.3/test/xdeltatest.c:424: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 diff_gzargs[16];
data/xdelta-1.1.3/test/xdeltatest.c:425: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 gzip_args[16];
data/xdelta-1.1.3/test/xdeltatest.c:429: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 (xdelta_args, "-qn%d", zlevel);
data/xdelta-1.1.3/test/xdeltatest.c:430: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 (xdelta_args2, "-s%d", slevel);
data/xdelta-1.1.3/test/xdeltatest.c:431: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 (diff_gzargs, "wb%d", zlevel);
data/xdelta-1.1.3/test/xdeltatest.c:432: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 (gzip_args, "-c%d", zlevel);
data/xdelta-1.1.3/test/xdeltatest.c:438:14:  [2] (race) vfork:
  On some old systems, vfork() permits race conditions, and it's very
  difficult to use correctly (CWE-362). Use fork() instead.
  if ((pid = vfork()) < 0)
data/xdelta-1.1.3/test/xdeltatest.c:457: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).
	  outfd = open (out->name, O_CREAT | O_TRUNC | O_WRONLY, 0777);
data/xdelta-1.1.3/test/xdeltatest.c:587:31:  [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 (! (data_source_handle = fopen (cmd_data_source, "r")))
data/xdelta-1.1.3/xdelta.c:281:7:  [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 exp[33], rec[33];
data/xdelta-1.1.3/xdelta.c:1087: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 (gen->control->to_md5, in_md5, 16);
data/xdelta-1.1.3/xdelta.c:1165: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 (si->md5, md5, 16);
data/xdelta-1.1.3/xdelta.c:1218: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 md5str[33];
data/xdelta-1.1.3/xdelta.c:1442: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 (cont->to_md5, ocont->to_info.real_md5, 16);
data/xdelta-1.1.3/xdelta.c:1454: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 (dinfo->md5, ocont->to_info.md5, 15);
data/xdelta-1.1.3/xdelta.c:1467:7:  [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 (info->md5, oinfo->md5, 16);
data/xdelta-1.1.3/xdmain.c:393:14:  [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).
	    int s = atoi (optarg);
data/xdelta-1.1.3/xdmain.c:540:13:  [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 (name, O_RDONLY | O_BINARY, 0)) < 0)
data/xdelta-1.1.3/xdmain.c:573: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).
  FILE* f = fopen (name, FOPEN_READ_ARG);
data/xdelta-1.1.3/xdmain.c:624: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).
  FILE* out = fopen (new_name, FOPEN_WRITE_ARG);
data/xdelta-1.1.3/xdmain.c:1519: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[2], O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
data/xdelta-1.1.3/xdmain.c:1770: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[33];
data/xdelta-1.1.3/xdmain.c:1870:19:  [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).
      to_out_fd = open (patch->to_name, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
data/xdelta-1.1.3/xdrsync.c:116: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 (rsync->file_md5, handle_checksum_md5 (str), 16);
data/xdelta-1.1.3/getopt.c:195:12:  [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).
extern int strlen (const char *);
data/xdelta-1.1.3/getopt.c:487:32:  [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).
	    if (nameend - nextchar == strlen (p->name))
data/xdelta-1.1.3/getopt.c:511:16:  [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).
	  nextchar += strlen (nextchar);
data/xdelta-1.1.3/getopt.c:541:17:  [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).
		  nextchar += strlen (nextchar);
data/xdelta-1.1.3/getopt.c:554:17:  [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).
		  nextchar += strlen (nextchar);
data/xdelta-1.1.3/getopt.c:558:16:  [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).
	  nextchar += strlen (nextchar);
data/xdelta-1.1.3/libedsio/default.c:87:39:  [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).
  return sink->next_bytes (sink, ptr, strlen (ptr));
data/xdelta-1.1.3/libedsio/edsio.c:572:12:  [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).
  gint l = strlen (buf);
data/xdelta-1.1.3/libedsio/edsio_edsio.c:442:11:  [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).
  size += strlen (val) + 1;
data/xdelta-1.1.3/libedsio/edsiotest.c:62:58:  [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).
  g_assert (proptest_set_bytes (pt, prop, (guint8*) str, strlen (str) + 1));
data/xdelta-1.1.3/libedsio/edsiotest.c:66:96:  [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).
  g_assert (proptest_get_bytes (pt, prop, (const guint8**) & str2, & str2_len) && str2_len == (strlen (str) + 1) && strcmp (str, str2) == 0);
data/xdelta-1.1.3/libedsio/edsiotest.c:71:96:  [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).
  g_assert (proptest_get_bytes (pt, prop, (const guint8**) & str2, & str2_len) && str2_len == (strlen (str) + 1) && strcmp (str, str2) == 0);
data/xdelta-1.1.3/test/xdeltatest.c:207:29:  [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).
  return strncmp (s, start, strlen (start)) == 0;
data/xdelta-1.1.3/xd_edsio.c:331:11:  [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).
  size += strlen (name) + 1;
data/xdelta-1.1.3/xdelta.c:238:50:  [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).
  if (strncmp (version, XDELTA_REQUIRED_VERSION, strlen (XDELTA_REQUIRED_VERSION)) != 0)
data/xdelta-1.1.3/xdmain.c:1281:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	  if (read (fh->fd, lru->buffer, to_map) != to_map)
data/xdelta-1.1.3/xdmain.c:1555:21:  [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).
  header_space[1] = strlen (from_name) << 16 | strlen (to_name);
data/xdelta-1.1.3/xdmain.c:1555:48:  [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).
  header_space[1] = strlen (from_name) << 16 | strlen (to_name);
data/xdelta-1.1.3/xdmain.c:1563:42:  [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).
  if (! xd_handle_write (out, from_name, strlen (from_name)))
data/xdelta-1.1.3/xdmain.c:1566:40:  [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).
  if (! xd_handle_write (out, to_name, strlen (to_name)))

ANALYSIS SUMMARY:

Hits = 104
Lines analyzed = 14849 in approximately 0.33 seconds (44471 lines/second)
Physical Source Lines of Code (SLOC) = 10490
Hits@level = [0]  49 [1]  20 [2]  59 [3]  18 [4]   7 [5]   0
Hits@level+ = [0+] 153 [1+] 104 [2+]  84 [3+]  25 [4+]   7 [5+]   0
Hits/KSLOC@level+ = [0+] 14.5853 [1+] 9.9142 [2+] 8.00763 [3+] 2.38322 [4+] 0.667302 [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.