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/xxdiff-5.0~b1+git20200622+dfsg/src/buffer.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/version.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/app.inline.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/builderFiles2.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/line.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/exceptions.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/diffs.inline.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/resParser.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/builder.inline.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/builderSingle.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/main.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/builderUnmerge.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/diffutils.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/lineNumbers.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/markers.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/text.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/util.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/cmdline.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/resParser.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/builderFiles3.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/diffs.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/builderDirs2.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/resources.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/central.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/text.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/types.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/optionsDialog.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/central.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/lineNumbers.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/compiler.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/builderUnmerge.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/buffer.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/merged.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/defs.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/line.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/builderFiles3.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/suicideMessageBox.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/builderSingle.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/borderLabel.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/diffs.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/copyLabel.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/hordiffImp.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/searchDialog.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/resources.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/proginfo.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/copyLabel.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/scrollView.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/kdeSupport.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/text.inline.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/accelUtil.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/help.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/line.inline.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/help.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/app.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/merged.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/resources.inline.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/app.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/overview.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/hordiffImp.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/overview.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/borderLabel.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/scrollView.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/cmdline.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/markers.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/accelUtil.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/builderDirs2.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/buffer.inline.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/winfixes/winfixes.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/winfixes/unistd.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/main.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/builder.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/builder.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/proginfo.c
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/optionsDialog.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/diffutils.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/suicideMessageBox.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/builderFiles2.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/exceptions.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/searchDialog.cpp
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/diffutils_hack.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/src/getopt1.c
Examining data/xxdiff-5.0~b1+git20200622+dfsg/test/split/st.h
Examining data/xxdiff-5.0~b1+git20200622+dfsg/test/split/st.cpp

FINAL RESULTS:

data/xxdiff-5.0~b1+git20200622+dfsg/src/app.cpp:3525:24:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
             tmpTitle->sprintf( "--title%d=%s",
data/xxdiff-5.0~b1+git20200622+dfsg/src/buffer.cpp:533:9:  [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( buffer, sizeof(buffer), lnFormat, fline );
data/xxdiff-5.0~b1+git20200622+dfsg/src/buffer.cpp:699:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
   _lnBuffer.sprintf( format.toLocal8Bit().constData(), lineNumber );
data/xxdiff-5.0~b1+git20200622+dfsg/src/diffutils.cpp:102:12:  [4] (format) vsnprintf:
  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.
      nb = vsnprintf( buffer, buflen, format, arg );
data/xxdiff-5.0~b1+git20200622+dfsg/src/diffutils_hack.h:45:9:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define printf  xxdiff_diff_printf
data/xxdiff-5.0~b1+git20200622+dfsg/src/diffutils_hack.h:46:9:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define fprintf  xxdiff_diff_fprintf
data/xxdiff-5.0~b1+git20200622+dfsg/src/diffutils_hack.h:47:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define vfprintf  xxdiff_diff_vfprintf
data/xxdiff-5.0~b1+git20200622+dfsg/src/lineNumbers.cpp:126:13:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
   lnFormat.sprintf( "%%%dd", _app->getMaxDigits() );
data/xxdiff-5.0~b1+git20200622+dfsg/src/text.cpp:55:9:  [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.
#define snprintf _snprintf
data/xxdiff-5.0~b1+git20200622+dfsg/src/text.cpp:55:18:  [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.
#define snprintf _snprintf
data/xxdiff-5.0~b1+git20200622+dfsg/src/text.cpp:1261:11:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
      buf.sprintf( "%d", fileno );
data/xxdiff-5.0~b1+git20200622+dfsg/src/text.cpp:1274:11:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
      buf.sprintf( "%d", lineno );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:53:9:  [4] (shell) popen:
  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.
#define popen _popen
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:149:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat, filename.toLocal8Bit().constData() );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:156:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat, filename.toLocal8Bit().constData() );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:169:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat, qfiToPerm( qfi ) );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:177:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat, qfiToHPerm( tbuf,qfi ) );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:184:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat, ( qfi.isFile()?"Regular File":
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:194:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat,qfi.owner().toLocal8Bit().constData() );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:201:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat,qfi.ownerId() );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:208:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat,qfi.group().toLocal8Bit().constData() );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:215:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat,qfi.groupId() );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:222:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat,qfi.size() );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:229:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat, XxUtil::toTime_t( qfi.lastRead() ) );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:238:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat,
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:246:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat, XxUtil::toTime_t( qfi.lastModified() ) );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:255:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat,
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:263:23:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
            QString().sprintf( "unknown %%-directive %c\n", m )
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:330:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat,
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:340:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf(
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:350:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf( pformat,
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:360:14:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
         tmp.sprintf(
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:369:23:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
            QString().sprintf( "unknown %%-directive %c\n", m )
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:407:14:  [4] (shell) popen:
  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.
   FILE* f = popen( cmd.toLocal8Bit().constData(), "r" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:779:4:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
   mktemp( tmplate );
data/xxdiff-5.0~b1+git20200622+dfsg/src/winfixes/winfixes.h:52:9:  [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.
#define snprintf _snprintf
data/xxdiff-5.0~b1+git20200622+dfsg/src/winfixes/winfixes.h:52:18:  [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.
#define snprintf _snprintf
data/xxdiff-5.0~b1+git20200622+dfsg/src/app.cpp:3288:53:  [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.
                   _mainWindow, QString(), QString( getenv("USERPROFILE") ) + QString( "\\.xxdiffrc" )
data/xxdiff-5.0~b1+git20200622+dfsg/src/app.cpp:3293:40:  [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.
      _mainWindow, QString(), QString( getenv("HOME") ) + QString( "/.xxdiffrc" ) 
data/xxdiff-5.0~b1+git20200622+dfsg/src/cmdline.cpp:440: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.
      int c = getopt_long( argc,
data/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:208:9:  [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.
#ifndef getenv
data/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:209:14:  [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.
extern char *getenv ();
data/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:404: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:970: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:1000: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.h:131: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.h:134: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.h:150: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.h:154: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.h:161: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.h:167:5:  [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.
int getopt_long (int argc,char *const *argv,const char *options,
data/xxdiff-5.0~b1+git20200622+dfsg/src/getopt1.c:67: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt1.c:123: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/xxdiff-5.0~b1+git20200622+dfsg/src/resParser.cpp:837:27:  [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.
   const char* XXDIFFRC = getenv( "XXDIFFRC" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/resParser.cpp:844: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.
	const char* HOME = getenv( "USERPROFILE" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/resParser.cpp:850:26:  [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.
      const char* HOME = getenv( "HOME" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/resources.cpp:321:25:  [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.
   const char* editor = getenv( "EDITOR" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/app.cpp:2664:27:  [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).
      bool succ = outfile.open( QIODevice::Truncate | QIODevice::WriteOnly );
data/xxdiff-5.0~b1+git20200622+dfsg/src/app.cpp:3062: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 temporaryFilename1[64] = "/var/tmp/xxdiff-tmp-patch.XXXXXX";
data/xxdiff-5.0~b1+git20200622+dfsg/src/app.cpp:3068: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 temporaryFilename2[64] = "/var/tmp/xxdiff-tmp-patch.XXXXXX";
data/xxdiff-5.0~b1+git20200622+dfsg/src/app.cpp:3206: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).
   bool succ = outfile.open( QIODevice::Truncate | QIODevice::WriteOnly );
data/xxdiff-5.0~b1+git20200622+dfsg/src/app.cpp:3305:27:  [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).
      bool succ = outfile.open( QIODevice::Truncate | QIODevice::WriteOnly );
data/xxdiff-5.0~b1+git20200622+dfsg/src/buffer.cpp:271: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* fp = fopen( _name.toLocal8Bit().constData(), "r" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/buffer.cpp:525:4:  [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 lnFormat[32];
data/xxdiff-5.0~b1+git20200622+dfsg/src/buffer.cpp:530:4:  [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 buffer[12];
data/xxdiff-5.0~b1+git20200622+dfsg/src/buffer.cpp:755:4:  [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 temporaryFilename[32] = "/var/tmp/xxdiff-tmp.XXXXXX";
data/xxdiff-5.0~b1+git20200622+dfsg/src/builderFiles3.cpp:221:4:  [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 cbuf[80];
data/xxdiff-5.0~b1+git20200622+dfsg/src/cmdline.cpp:603:13:  [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 optionString[4];
data/xxdiff-5.0~b1+git20200622+dfsg/src/diffs.cpp:1835: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 buf1[ COMPBUFSIZE ];
data/xxdiff-5.0~b1+git20200622+dfsg/src/diffs.cpp:1836: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 buf2[ COMPBUFSIZE ];
data/xxdiff-5.0~b1+git20200622+dfsg/src/diffs.cpp:1892: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.
         char buf3[ COMPBUFSIZE ];
data/xxdiff-5.0~b1+git20200622+dfsg/src/hordiffImp.cpp:201: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 c[2];
data/xxdiff-5.0~b1+git20200622+dfsg/src/hordiffImp.cpp:245: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 c[2];
data/xxdiff-5.0~b1+git20200622+dfsg/src/hordiffImp.cpp:324: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 c[3];
data/xxdiff-5.0~b1+git20200622+dfsg/src/hordiffImp.cpp:372: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 c[3];
data/xxdiff-5.0~b1+git20200622+dfsg/src/resParser.cpp:894: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).
   if ( file.open( QIODevice::ReadOnly ) ) {
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:176: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.
         char tbuf[11];
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:220:10:  [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( pformat, "lu" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:389: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 buffer[BUFSIZ];
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:497:4:  [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 buffer[1024];
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:499: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).
   fd = open( filename.toLocal8Bit().constData(), O_RDONLY );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:688:10:  [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( dest + 1, p, len );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:776:14:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
   int tfd = mkstemp( tmplate );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:780: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).
   if ( ( ftmp = ::fopen( tmplate, "w" ) ) == NULL ) {
data/xxdiff-5.0~b1+git20200622+dfsg/src/accelUtil.cpp:41:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
bool XxAccelUtil::read( const QString& val, int& accel )
data/xxdiff-5.0~b1+git20200622+dfsg/src/accelUtil.h:73:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   static bool read( const QString& val, int& accel );
data/xxdiff-5.0~b1+git20200622+dfsg/src/buffer.cpp:58:31:  [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).
   const char* pe = p + n - ::strlen( needle );
data/xxdiff-5.0~b1+git20200622+dfsg/src/buffer.cpp:366:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      ::strncpy( bufferPtr, (*it).toLocal8Bit().constData(), len );
data/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:231:51:  [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 (!defined __STDC__ || !__STDC__) && !defined strlen
data/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:234: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:436:44:  [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 = nonoption_flags_max_len = strlen (orig_str);
data/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:657: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).
		== (unsigned int) strlen (p->name))
data/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:681: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:713: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:729: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:734: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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:845:51:  [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 ((unsigned int) (nameend - nextchar) == strlen (p->name))
data/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:868:18:  [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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:888:19:  [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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:902:19:  [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/xxdiff-5.0~b1+git20200622+dfsg/src/getopt.c:906:18:  [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/xxdiff-5.0~b1+git20200622+dfsg/src/help.cpp:124:20:  [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).
      len += 2 + ::strlen( options[ii]._longname ); // "--opt"
data/xxdiff-5.0~b1+git20200622+dfsg/src/help.cpp:145:20:  [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).
      len += 2 + ::strlen( options[ii]._longname );
data/xxdiff-5.0~b1+git20200622+dfsg/src/resources.cpp:437:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   if ( XxAccelUtil::read( val, accelval ) == true ) {
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:147:10:  [1] (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 character.
         strcat( pformat, "s" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:154:10:  [1] (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 character.
         strcat( pformat, "s" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:167:10:  [1] (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 character.
         strcat( pformat, "u" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:174:10:  [1] (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 character.
         strcat( pformat, "s" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:182:10:  [1] (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 character.
         strcat( pformat, "s" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:192:10:  [1] (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 character.
         strcat( pformat, "s" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:199:10:  [1] (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 character.
         strcat( pformat, "u" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:206:10:  [1] (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 character.
         strcat( pformat, "s" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:213:10:  [1] (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 character.
         strcat( pformat, "u" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:227:10:  [1] (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 character.
         strcat( pformat, "d" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:234:10:  [1] (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 character.
         strcat( pformat, "s" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:244:10:  [1] (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 character.
         strcat( pformat, "d" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:251:10:  [1] (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 character.
         strcat( pformat, "s" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:328:10:  [1] (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 character.
         strcat( pformat, "d" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:336:10:  [1] (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 character.
         strcat( pformat, "s" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:348:10:  [1] (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 character.
         strcat( pformat, "d" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:356:10:  [1] (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 character.
         strcat( pformat, "s" );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:500:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   bytes = read( fd, (void *)buffer, 1024 );
data/xxdiff-5.0~b1+git20200622+dfsg/src/util.cpp:669:33:  [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).
   char* dest = (char*) malloc( strlen( format ) + 1 );

ANALYSIS SUMMARY:

Hits = 123
Lines analyzed = 31431 in approximately 0.67 seconds (46834 lines/second)
Physical Source Lines of Code (SLOC) = 20031
Hits@level = [0]  72 [1]  39 [2]  27 [3]  20 [4]  37 [5]   0
Hits@level+ = [0+] 195 [1+] 123 [2+]  84 [3+]  57 [4+]  37 [5+]   0
Hits/KSLOC@level+ = [0+] 9.73491 [1+] 6.14048 [2+] 4.1935 [3+] 2.84559 [4+] 1.84714 [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.