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/apt-2.1.12/apt-pkg/acquire-item.cc
Examining data/apt-2.1.12/apt-pkg/acquire-item.h
Examining data/apt-2.1.12/apt-pkg/acquire-method.cc
Examining data/apt-2.1.12/apt-pkg/acquire-method.h
Examining data/apt-2.1.12/apt-pkg/acquire-worker.cc
Examining data/apt-2.1.12/apt-pkg/acquire-worker.h
Examining data/apt-2.1.12/apt-pkg/acquire.cc
Examining data/apt-2.1.12/apt-pkg/acquire.h
Examining data/apt-2.1.12/apt-pkg/algorithms.cc
Examining data/apt-2.1.12/apt-pkg/algorithms.h
Examining data/apt-2.1.12/apt-pkg/aptconfiguration.cc
Examining data/apt-2.1.12/apt-pkg/aptconfiguration.h
Examining data/apt-2.1.12/apt-pkg/cachefile.cc
Examining data/apt-2.1.12/apt-pkg/cachefile.h
Examining data/apt-2.1.12/apt-pkg/cachefilter-patterns.cc
Examining data/apt-2.1.12/apt-pkg/cachefilter-patterns.h
Examining data/apt-2.1.12/apt-pkg/cachefilter.cc
Examining data/apt-2.1.12/apt-pkg/cachefilter.h
Examining data/apt-2.1.12/apt-pkg/cacheiterators.h
Examining data/apt-2.1.12/apt-pkg/cacheset.cc
Examining data/apt-2.1.12/apt-pkg/cacheset.h
Examining data/apt-2.1.12/apt-pkg/cdrom.cc
Examining data/apt-2.1.12/apt-pkg/cdrom.h
Examining data/apt-2.1.12/apt-pkg/clean.cc
Examining data/apt-2.1.12/apt-pkg/clean.h
Examining data/apt-2.1.12/apt-pkg/contrib/arfile.cc
Examining data/apt-2.1.12/apt-pkg/contrib/arfile.h
Examining data/apt-2.1.12/apt-pkg/contrib/cdromutl.cc
Examining data/apt-2.1.12/apt-pkg/contrib/cdromutl.h
Examining data/apt-2.1.12/apt-pkg/contrib/cmndline.cc
Examining data/apt-2.1.12/apt-pkg/contrib/cmndline.h
Examining data/apt-2.1.12/apt-pkg/contrib/configuration.cc
Examining data/apt-2.1.12/apt-pkg/contrib/configuration.h
Examining data/apt-2.1.12/apt-pkg/contrib/error.cc
Examining data/apt-2.1.12/apt-pkg/contrib/error.h
Examining data/apt-2.1.12/apt-pkg/contrib/extracttar.cc
Examining data/apt-2.1.12/apt-pkg/contrib/extracttar.h
Examining data/apt-2.1.12/apt-pkg/contrib/fileutl.cc
Examining data/apt-2.1.12/apt-pkg/contrib/fileutl.h
Examining data/apt-2.1.12/apt-pkg/contrib/gpgv.cc
Examining data/apt-2.1.12/apt-pkg/contrib/gpgv.h
Examining data/apt-2.1.12/apt-pkg/contrib/hashes.cc
Examining data/apt-2.1.12/apt-pkg/contrib/hashes.h
Examining data/apt-2.1.12/apt-pkg/contrib/macros.h
Examining data/apt-2.1.12/apt-pkg/contrib/mmap.cc
Examining data/apt-2.1.12/apt-pkg/contrib/mmap.h
Examining data/apt-2.1.12/apt-pkg/contrib/netrc.cc
Examining data/apt-2.1.12/apt-pkg/contrib/netrc.h
Examining data/apt-2.1.12/apt-pkg/contrib/progress.cc
Examining data/apt-2.1.12/apt-pkg/contrib/progress.h
Examining data/apt-2.1.12/apt-pkg/contrib/proxy.cc
Examining data/apt-2.1.12/apt-pkg/contrib/proxy.h
Examining data/apt-2.1.12/apt-pkg/contrib/srvrec.cc
Examining data/apt-2.1.12/apt-pkg/contrib/srvrec.h
Examining data/apt-2.1.12/apt-pkg/contrib/string_view.h
Examining data/apt-2.1.12/apt-pkg/contrib/strutl.cc
Examining data/apt-2.1.12/apt-pkg/contrib/strutl.h
Examining data/apt-2.1.12/apt-pkg/contrib/weakptr.h
Examining data/apt-2.1.12/apt-pkg/deb/debfile.cc
Examining data/apt-2.1.12/apt-pkg/deb/debfile.h
Examining data/apt-2.1.12/apt-pkg/deb/debindexfile.cc
Examining data/apt-2.1.12/apt-pkg/deb/debindexfile.h
Examining data/apt-2.1.12/apt-pkg/deb/deblistparser.cc
Examining data/apt-2.1.12/apt-pkg/deb/deblistparser.h
Examining data/apt-2.1.12/apt-pkg/deb/debmetaindex.cc
Examining data/apt-2.1.12/apt-pkg/deb/debmetaindex.h
Examining data/apt-2.1.12/apt-pkg/deb/debrecords.cc
Examining data/apt-2.1.12/apt-pkg/deb/debrecords.h
Examining data/apt-2.1.12/apt-pkg/deb/debsrcrecords.cc
Examining data/apt-2.1.12/apt-pkg/deb/debsrcrecords.h
Examining data/apt-2.1.12/apt-pkg/deb/debsystem.cc
Examining data/apt-2.1.12/apt-pkg/deb/debsystem.h
Examining data/apt-2.1.12/apt-pkg/deb/debversion.cc
Examining data/apt-2.1.12/apt-pkg/deb/debversion.h
Examining data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc
Examining data/apt-2.1.12/apt-pkg/deb/dpkgpm.h
Examining data/apt-2.1.12/apt-pkg/depcache.cc
Examining data/apt-2.1.12/apt-pkg/depcache.h
Examining data/apt-2.1.12/apt-pkg/dirstream.cc
Examining data/apt-2.1.12/apt-pkg/dirstream.h
Examining data/apt-2.1.12/apt-pkg/edsp/edspindexfile.cc
Examining data/apt-2.1.12/apt-pkg/edsp/edspindexfile.h
Examining data/apt-2.1.12/apt-pkg/edsp/edsplistparser.cc
Examining data/apt-2.1.12/apt-pkg/edsp/edsplistparser.h
Examining data/apt-2.1.12/apt-pkg/edsp/edspsystem.cc
Examining data/apt-2.1.12/apt-pkg/edsp/edspsystem.h
Examining data/apt-2.1.12/apt-pkg/edsp.cc
Examining data/apt-2.1.12/apt-pkg/edsp.h
Examining data/apt-2.1.12/apt-pkg/indexcopy.cc
Examining data/apt-2.1.12/apt-pkg/indexcopy.h
Examining data/apt-2.1.12/apt-pkg/indexfile.cc
Examining data/apt-2.1.12/apt-pkg/indexfile.h
Examining data/apt-2.1.12/apt-pkg/init.cc
Examining data/apt-2.1.12/apt-pkg/init.h
Examining data/apt-2.1.12/apt-pkg/install-progress.cc
Examining data/apt-2.1.12/apt-pkg/install-progress.h
Examining data/apt-2.1.12/apt-pkg/metaindex.cc
Examining data/apt-2.1.12/apt-pkg/metaindex.h
Examining data/apt-2.1.12/apt-pkg/orderlist.cc
Examining data/apt-2.1.12/apt-pkg/orderlist.h
Examining data/apt-2.1.12/apt-pkg/packagemanager.cc
Examining data/apt-2.1.12/apt-pkg/packagemanager.h
Examining data/apt-2.1.12/apt-pkg/pkgcache.cc
Examining data/apt-2.1.12/apt-pkg/pkgcache.h
Examining data/apt-2.1.12/apt-pkg/pkgcachegen.cc
Examining data/apt-2.1.12/apt-pkg/pkgcachegen.h
Examining data/apt-2.1.12/apt-pkg/pkgrecords.cc
Examining data/apt-2.1.12/apt-pkg/pkgrecords.h
Examining data/apt-2.1.12/apt-pkg/pkgsystem.cc
Examining data/apt-2.1.12/apt-pkg/pkgsystem.h
Examining data/apt-2.1.12/apt-pkg/policy.cc
Examining data/apt-2.1.12/apt-pkg/policy.h
Examining data/apt-2.1.12/apt-pkg/prettyprinters.cc
Examining data/apt-2.1.12/apt-pkg/prettyprinters.h
Examining data/apt-2.1.12/apt-pkg/sourcelist.cc
Examining data/apt-2.1.12/apt-pkg/sourcelist.h
Examining data/apt-2.1.12/apt-pkg/srcrecords.cc
Examining data/apt-2.1.12/apt-pkg/srcrecords.h
Examining data/apt-2.1.12/apt-pkg/statechanges.cc
Examining data/apt-2.1.12/apt-pkg/statechanges.h
Examining data/apt-2.1.12/apt-pkg/tagfile-order.c
Examining data/apt-2.1.12/apt-pkg/tagfile.cc
Examining data/apt-2.1.12/apt-pkg/tagfile.h
Examining data/apt-2.1.12/apt-pkg/update.cc
Examining data/apt-2.1.12/apt-pkg/update.h
Examining data/apt-2.1.12/apt-pkg/upgrade.cc
Examining data/apt-2.1.12/apt-pkg/upgrade.h
Examining data/apt-2.1.12/apt-pkg/version.cc
Examining data/apt-2.1.12/apt-pkg/version.h
Examining data/apt-2.1.12/apt-pkg/versionmatch.cc
Examining data/apt-2.1.12/apt-pkg/versionmatch.h
Examining data/apt-2.1.12/apt-private/acqprogress.cc
Examining data/apt-2.1.12/apt-private/acqprogress.h
Examining data/apt-2.1.12/apt-private/private-cachefile.cc
Examining data/apt-2.1.12/apt-private/private-cachefile.h
Examining data/apt-2.1.12/apt-private/private-cacheset.cc
Examining data/apt-2.1.12/apt-private/private-cacheset.h
Examining data/apt-2.1.12/apt-private/private-cmndline.cc
Examining data/apt-2.1.12/apt-private/private-cmndline.h
Examining data/apt-2.1.12/apt-private/private-depends.cc
Examining data/apt-2.1.12/apt-private/private-depends.h
Examining data/apt-2.1.12/apt-private/private-download.cc
Examining data/apt-2.1.12/apt-private/private-download.h
Examining data/apt-2.1.12/apt-private/private-install.cc
Examining data/apt-2.1.12/apt-private/private-install.h
Examining data/apt-2.1.12/apt-private/private-json-hooks.cc
Examining data/apt-2.1.12/apt-private/private-json-hooks.h
Examining data/apt-2.1.12/apt-private/private-list.cc
Examining data/apt-2.1.12/apt-private/private-list.h
Examining data/apt-2.1.12/apt-private/private-main.cc
Examining data/apt-2.1.12/apt-private/private-main.h
Examining data/apt-2.1.12/apt-private/private-moo.cc
Examining data/apt-2.1.12/apt-private/private-moo.h
Examining data/apt-2.1.12/apt-private/private-output.cc
Examining data/apt-2.1.12/apt-private/private-output.h
Examining data/apt-2.1.12/apt-private/private-search.cc
Examining data/apt-2.1.12/apt-private/private-search.h
Examining data/apt-2.1.12/apt-private/private-show.cc
Examining data/apt-2.1.12/apt-private/private-show.h
Examining data/apt-2.1.12/apt-private/private-source.cc
Examining data/apt-2.1.12/apt-private/private-source.h
Examining data/apt-2.1.12/apt-private/private-sources.cc
Examining data/apt-2.1.12/apt-private/private-sources.h
Examining data/apt-2.1.12/apt-private/private-unmet.cc
Examining data/apt-2.1.12/apt-private/private-unmet.h
Examining data/apt-2.1.12/apt-private/private-update.cc
Examining data/apt-2.1.12/apt-private/private-update.h
Examining data/apt-2.1.12/apt-private/private-upgrade.cc
Examining data/apt-2.1.12/apt-private/private-upgrade.h
Examining data/apt-2.1.12/apt-private/private-utils.cc
Examining data/apt-2.1.12/apt-private/private-utils.h
Examining data/apt-2.1.12/cmdline/apt-cache.cc
Examining data/apt-2.1.12/cmdline/apt-cdrom.cc
Examining data/apt-2.1.12/cmdline/apt-config.cc
Examining data/apt-2.1.12/cmdline/apt-dump-solver.cc
Examining data/apt-2.1.12/cmdline/apt-extracttemplates.cc
Examining data/apt-2.1.12/cmdline/apt-extracttemplates.h
Examining data/apt-2.1.12/cmdline/apt-get.cc
Examining data/apt-2.1.12/cmdline/apt-helper.cc
Examining data/apt-2.1.12/cmdline/apt-internal-planner.cc
Examining data/apt-2.1.12/cmdline/apt-internal-solver.cc
Examining data/apt-2.1.12/cmdline/apt-mark.cc
Examining data/apt-2.1.12/cmdline/apt-sortpkgs.cc
Examining data/apt-2.1.12/cmdline/apt.cc
Examining data/apt-2.1.12/ftparchive/apt-ftparchive.cc
Examining data/apt-2.1.12/ftparchive/apt-ftparchive.h
Examining data/apt-2.1.12/ftparchive/byhash.cc
Examining data/apt-2.1.12/ftparchive/byhash.h
Examining data/apt-2.1.12/ftparchive/cachedb.cc
Examining data/apt-2.1.12/ftparchive/cachedb.h
Examining data/apt-2.1.12/ftparchive/contents.cc
Examining data/apt-2.1.12/ftparchive/contents.h
Examining data/apt-2.1.12/ftparchive/multicompress.cc
Examining data/apt-2.1.12/ftparchive/multicompress.h
Examining data/apt-2.1.12/ftparchive/override.cc
Examining data/apt-2.1.12/ftparchive/override.h
Examining data/apt-2.1.12/ftparchive/sources.cc
Examining data/apt-2.1.12/ftparchive/sources.h
Examining data/apt-2.1.12/ftparchive/writer.cc
Examining data/apt-2.1.12/ftparchive/writer.h
Examining data/apt-2.1.12/methods/aptmethod.h
Examining data/apt-2.1.12/methods/basehttp.cc
Examining data/apt-2.1.12/methods/basehttp.h
Examining data/apt-2.1.12/methods/cdrom.cc
Examining data/apt-2.1.12/methods/connect.cc
Examining data/apt-2.1.12/methods/connect.h
Examining data/apt-2.1.12/methods/copy.cc
Examining data/apt-2.1.12/methods/file.cc
Examining data/apt-2.1.12/methods/ftp.cc
Examining data/apt-2.1.12/methods/ftp.h
Examining data/apt-2.1.12/methods/gpgv.cc
Examining data/apt-2.1.12/methods/http.cc
Examining data/apt-2.1.12/methods/http.h
Examining data/apt-2.1.12/methods/mirror.cc
Examining data/apt-2.1.12/methods/rfc2553emu.cc
Examining data/apt-2.1.12/methods/rfc2553emu.h
Examining data/apt-2.1.12/methods/rred.cc
Examining data/apt-2.1.12/methods/rsh.cc
Examining data/apt-2.1.12/methods/rsh.h
Examining data/apt-2.1.12/methods/store.cc
Examining data/apt-2.1.12/test/interactive-helper/aptdropprivs.cc
Examining data/apt-2.1.12/test/interactive-helper/aptwebserver.cc
Examining data/apt-2.1.12/test/interactive-helper/extract-control.cc
Examining data/apt-2.1.12/test/interactive-helper/libnoprofile.c
Examining data/apt-2.1.12/test/interactive-helper/mthdcat.cc
Examining data/apt-2.1.12/test/interactive-helper/rpmver.cc
Examining data/apt-2.1.12/test/interactive-helper/teestream.h
Examining data/apt-2.1.12/test/interactive-helper/test_fileutl.cc
Examining data/apt-2.1.12/test/interactive-helper/test_udevcdrom.cc
Examining data/apt-2.1.12/test/interactive-helper/testdeb.cc
Examining data/apt-2.1.12/test/libapt/acqprogress_test.cc
Examining data/apt-2.1.12/test/libapt/authconf_test.cc
Examining data/apt-2.1.12/test/libapt/cachefilter_test.cc
Examining data/apt-2.1.12/test/libapt/cdrom_test.cc
Examining data/apt-2.1.12/test/libapt/cdromfindpackages_test.cc
Examining data/apt-2.1.12/test/libapt/commandline_test.cc
Examining data/apt-2.1.12/test/libapt/compareversion_test.cc
Examining data/apt-2.1.12/test/libapt/configuration_test.cc
Examining data/apt-2.1.12/test/libapt/extracttar_test.cc
Examining data/apt-2.1.12/test/libapt/file-helpers.cc
Examining data/apt-2.1.12/test/libapt/file-helpers.h
Examining data/apt-2.1.12/test/libapt/fileutl_test.cc
Examining data/apt-2.1.12/test/libapt/getarchitectures_test.cc
Examining data/apt-2.1.12/test/libapt/getlanguages_test.cc
Examining data/apt-2.1.12/test/libapt/getlistoffilesindir_test.cc
Examining data/apt-2.1.12/test/libapt/globalerror_test.cc
Examining data/apt-2.1.12/test/libapt/gtest_runner.cc
Examining data/apt-2.1.12/test/libapt/hashsums_test.cc
Examining data/apt-2.1.12/test/libapt/indexcopytosourcelist_test.cc
Examining data/apt-2.1.12/test/libapt/install_progress_test.cc
Examining data/apt-2.1.12/test/libapt/openmaybeclearsignedfile_test.cc
Examining data/apt-2.1.12/test/libapt/parsedepends_test.cc
Examining data/apt-2.1.12/test/libapt/pattern_test.cc
Examining data/apt-2.1.12/test/libapt/priority_test.cc
Examining data/apt-2.1.12/test/libapt/sourcelist_test.cc
Examining data/apt-2.1.12/test/libapt/srvrecs_test.cc
Examining data/apt-2.1.12/test/libapt/stringview_test.cc
Examining data/apt-2.1.12/test/libapt/strutil_test.cc
Examining data/apt-2.1.12/test/libapt/tagfile_test.cc
Examining data/apt-2.1.12/test/libapt/tagsection_test.cc
Examining data/apt-2.1.12/test/libapt/teestream_test.cc
Examining data/apt-2.1.12/test/libapt/uri_test.cc

FINAL RESULTS:

data/apt-2.1.12/apt-pkg/acquire-item.cc:586:27:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
		     ssize_t const sp = readlink(PartialFile.c_str(), partial, Buf.st_size);
data/apt-2.1.12/apt-pkg/acquire-item.cc:4022:4:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
   chmod(tmpdir.get(), 0755);
data/apt-2.1.12/apt-pkg/acquire.cc:107:9:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
	    if(chown(partial.c_str(), pw->pw_uid, gr->gr_gid) != 0)
data/apt-2.1.12/apt-pkg/acquire.cc:111:11:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
      if (chmod(partial.c_str(), mode) != 0)
data/apt-2.1.12/apt-pkg/acquire.cc:115:13:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
   else if (chmod(partial.c_str(), mode) != 0)
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:721:18:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
      if ((Res = readlink(NFile.c_str(),Buffer,sizeof(Buffer))) <= 0 || 
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1035:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
   if (chmod(file, mode) != 0)
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:1035:35:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
	 if (pw != NULL && gr != NULL && chown(logfile_name.c_str(), pw->pw_uid, gr->gr_gid) != 0)
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:1038:11:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
      if (chmod(logfile_name.c_str(), 0640) != 0)
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:1054:7:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
      chmod(history_name.c_str(), 0644);
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2389:7:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
      chmod(reportfile.c_str(), 0);
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2391:7:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
      chmod(reportfile.c_str(), 0600);
data/apt-2.1.12/apt-pkg/depcache.cc:420:4:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
   chmod(state.c_str(), 0644);
data/apt-2.1.12/apt-private/private-download.cc:234:3:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	 chmod(filename.c_str(), 0644);
data/apt-2.1.12/ftparchive/multicompress.cc:230:3:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
	 chmod(I->Output.c_str(),Permissions);
data/apt-2.1.12/ftparchive/multicompress.cc:349:7:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
      chmod(I->TmpFile.Name().c_str(),Permissions);
data/apt-2.1.12/ftparchive/writer.cc:148:8:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
       readlink(File,Jnk,sizeof(Jnk)) != -1 &&
data/apt-2.1.12/ftparchive/writer.cc:310:10:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
	    if (readlink(OriginalPath,OldLink,sizeof(OldLink)) == -1)
data/apt-2.1.12/ftparchive/writer.cc:822:11:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
      if (readlink(OriginalPath.c_str(),Jnk,sizeof(Jnk)) != -1 &&
data/apt-2.1.12/methods/aptmethod.h:137:13:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
      ALLOW(chmod);
data/apt-2.1.12/methods/aptmethod.h:138:13:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
      ALLOW(chown);
data/apt-2.1.12/apt-pkg/acquire-item.cc:160:7:  [4] (shell) execvp:
  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.
      execvp(Args[0], (char**)Args.data());
data/apt-2.1.12/apt-pkg/acquire-method.cc:472:4:  [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.
   vfprintf(stdout,Format,args);
data/apt-2.1.12/apt-pkg/acquire-worker.cc:155:7:  [4] (shell) execv:
  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.
      execv(Method.c_str() ,const_cast<char **>(Args));
data/apt-2.1.12/apt-pkg/contrib/cdromutl.cc:101:10:  [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.
	    if (system(_config->Find("Acquire::cdrom::"+Path+"::UMount").c_str()) != 0)
data/apt-2.1.12/apt-pkg/contrib/cdromutl.cc:112:6:  [4] (shell) execvp:
  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.
	    execvp(Args[0], const_cast<char **>(Args));
data/apt-2.1.12/apt-pkg/contrib/cdromutl.cc:152: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.
	 if (system(_config->Find("Acquire::cdrom::"+Path+"::Mount").c_str()) != 0)
data/apt-2.1.12/apt-pkg/contrib/cdromutl.cc:169:3:  [4] (shell) execvp:
  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.
	 execvp(Args[0],(char **)Args);      
data/apt-2.1.12/apt-pkg/contrib/error.cc:141:16:  [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.
	int const n = vsnprintf(S, msgSize, Description, args);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:128: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.
	 if (system(Opts->Value.c_str()) != 0)
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:2292:3:  [4] (shell) execvp:
  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.
	 execvp(Args[0],(char **)&Args[0]);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:3253:7:  [4] (shell) execv:
  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.
      execv(Args[0], (char**)Args);
data/apt-2.1.12/apt-pkg/contrib/gpgv.cc:127:22:  [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.
   ssize_t const n = vsnprintf(S.get(), size, format, args);
data/apt-2.1.12/apt-pkg/contrib/gpgv.cc:399:7:  [4] (shell) execvp:
  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.
      execvp(Args[0], (char **) &Args[0]);
data/apt-2.1.12/apt-pkg/contrib/macros.h:50:46:  [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 APT_PRINTF(n)	__attribute__((format(printf, n, n + 1)))
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:1438:22:  [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.
   ssize_t const n = vsnprintf(S, size, format, args);
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:1495:10:  [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.
   Did = vsnprintf(Buffer,End - Buffer,Format,args);
data/apt-2.1.12/apt-pkg/deb/debsystem.cc:450:7:  [4] (shell) execvp:
  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.
      execvp(Args[0], (char**) &Args[0]);
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:194:7:  [4] (shell) execv:
  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.
      execv(Args[0], (char **)Args);
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:489:3:  [4] (shell) execv:
  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.
	 execv(Args[0],(char **)Args);
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2037:3:  [4] (shell) execvp:
  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.
	 execvp(Args[0], (char**) &Args[0]);
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2462:19:  [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 *log = popen("/bin/dmesg","r");
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2477:19:  [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 *log = popen("/bin/df -l -x squashfs","r");
data/apt-2.1.12/apt-pkg/edsp.cc:694:6:  [4] (shell) execv:
  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.
		   execv(calling[0], const_cast<char**>(calling));
data/apt-2.1.12/apt-pkg/edsp.cc:699:6:  [4] (shell) execv:
  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.
		   execv(calling[0], const_cast<char**>(calling));
data/apt-2.1.12/apt-pkg/pkgcachegen.cc:1728:15:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	 Writeable = access(flNotFile(CacheFileName).c_str(),W_OK) == 0;
data/apt-2.1.12/apt-pkg/pkgcachegen.cc:1730:15:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	 Writeable = access(flNotFile(SrcCacheFileName).c_str(),W_OK) == 0;
data/apt-2.1.12/apt-private/private-json-hooks.cc:371:3:  [4] (shell) execv:
  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.
	 execv(Args[0], (char **)Args);
data/apt-2.1.12/apt-private/private-source.cc:523: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.
	 if (system(S.c_str()) != 0)
data/apt-2.1.12/apt-private/private-source.cc:556: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.
	 if (system(S.c_str()) != 0)
data/apt-2.1.12/apt-private/private-utils.cc:28:3:  [4] (shell) execvp:
  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.
	 execvp(Args[0],(char **)Args);
data/apt-2.1.12/apt-private/private-utils.cc:32:6:  [4] (shell) execvp:
  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.
	    execvp(Args[0],(char **)Args);
data/apt-2.1.12/apt-private/private-utils.cc:35:3:  [4] (shell) execvp:
  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.
	 execvp(Args[0],(char **)Args);
data/apt-2.1.12/apt-private/private-utils.cc:39:7:  [4] (shell) execvp:
  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.
      execvp(Args[0],(char **)Args);
data/apt-2.1.12/apt-private/private-utils.cc:60:7:  [4] (shell) execvp:
  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.
      execvp(Args[0],(char **)Args);
data/apt-2.1.12/apt-private/private-utils.cc:64:3:  [4] (shell) execvp:
  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.
	 execvp(Args[0],(char **)Args);
data/apt-2.1.12/apt-private/private-utils.cc:68:3:  [4] (shell) execvp:
  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.
	 execvp(Args[0],(char **)Args);
data/apt-2.1.12/apt-private/private-utils.cc:71:7:  [4] (shell) execvp:
  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.
      execvp(Args[0],(char **)Args);
data/apt-2.1.12/cmdline/apt-dump-solver.cc:114:3:  [4] (shell) execv:
  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.
	 execv(CmdL.FileList[1], const_cast<char**>(CmdL.FileList + 1));
data/apt-2.1.12/cmdline/apt-helper.cc:210:7:  [4] (shell) execvp:
  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.
      execvp(Args[0], (char **)Args);
data/apt-2.1.12/ftparchive/contents.cc:280:7:  [4] (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).
      strcat(Buf,Top->Path);
data/apt-2.1.12/ftparchive/contents.cc:357:4:  [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(Data+CurSize,Itm.Name);   
data/apt-2.1.12/ftparchive/writer.cc:674:7:  [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(Buffer,Bins.c_str());
data/apt-2.1.12/methods/aptmethod.h:88:3:  [4] (shell) execv:
  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.
	 execv(argv[0], argv);
data/apt-2.1.12/methods/aptmethod.h:134:13:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
      ALLOW(access);
data/apt-2.1.12/methods/ftp.cc:468:4:  [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.
   vsnprintf(S,sizeof(S) - 4,Fmt,args);
data/apt-2.1.12/methods/ftp.cc:1182:3:  [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(Path.c_str(),Path.c_str(),(char *)NULL);
data/apt-2.1.12/methods/mirror.cc:211:35:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
      if (APT::String::Startswith(access, "mirror") == false)
data/apt-2.1.12/methods/mirror.cc:215:3:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	 access.erase(0, plus + 1);
data/apt-2.1.12/methods/mirror.cc:222:11:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
		      [&access](char const *const a) { return APT::String::Endswith(access, std::string("+") + a); }) ||
data/apt-2.1.12/methods/mirror.cc:222:71:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
		      [&access](char const *const a) { return APT::String::Endswith(access, std::string("+") + a); }) ||
data/apt-2.1.12/methods/mirror.cc:233:89:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	 if (limitAccess.empty() == false && std::find(limitAccess.begin(), limitAccess.end(), access) == limitAccess.end())
data/apt-2.1.12/methods/mirror.cc:326:34:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	    if (APT::String::Startswith(access, "mirror") == false)
data/apt-2.1.12/methods/rsh.cc:156:7:  [4] (shell) execvp:
  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.
      execvp(Args[0],(char **)Args);
data/apt-2.1.12/methods/rsh.cc:238:4:  [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.
   vsnprintf(Tmp,sizeof(Tmp),Fmt,args);
data/apt-2.1.12/test/interactive-helper/aptdropprivs.cc:26:11:  [4] (shell) execv:
  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.
   return execv(CmdL.FileList[0], const_cast<char**>(CmdL.FileList));
data/apt-2.1.12/test/interactive-helper/libnoprofile.c:9:5:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
int vprintf(const char *format, va_list ap) {
data/apt-2.1.12/test/interactive-helper/libnoprofile.c:19:5:  [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.
int printf(const char *format, ...) {
data/apt-2.1.12/test/interactive-helper/libnoprofile.c:22:15:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    int res = vprintf(format, ap);
data/apt-2.1.12/test/interactive-helper/libnoprofile.c:27:5:  [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.
int vfprintf(FILE *stream, const char *format, va_list ap) {
data/apt-2.1.12/test/interactive-helper/libnoprofile.c:38:5:  [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.
int fprintf(FILE *stream, const char *format, ...) {
data/apt-2.1.12/test/interactive-helper/libnoprofile.c:41:15:  [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.
    int res = vfprintf(stream, format, ap);
data/apt-2.1.12/test/interactive-helper/rpmver.cc:28:5:  [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(str1, a);
data/apt-2.1.12/test/interactive-helper/rpmver.cc:29:5:  [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(str2, b);
data/apt-2.1.12/test/interactive-helper/test_fileutl.cc:17:15:  [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.
   auto ret = system(call.c_str());
data/apt-2.1.12/test/libapt/compareversion_test.cc:47:7:  [4] (shell) execvp:
  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.
      execvp(args[0], (char**) args);
data/apt-2.1.12/test/libapt/extracttar_test.cc:30:17:  [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.
   EXPECT_EQ(0, system(("tar c /etc/passwd 2>/dev/null | gzip > " + tgz.Name()).c_str()));
data/apt-2.1.12/test/libapt/file-helpers.cc:28:20:  [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.
      ASSERT_EQ(0, system(std::string("rm -rf ").append(dir).c_str()));
data/apt-2.1.12/test/libapt/getlanguages_test.cc:239:17:  [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.
   EXPECT_EQ(0, system(std::string("rm -rf ").append(tempdir).c_str()));
data/apt-2.1.12/apt-pkg/aptconfiguration.cc:240:30:  [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 *language_env = getenv("LANGUAGE") == 0 ? "" : getenv("LANGUAGE");
data/apt-2.1.12/apt-pkg/aptconfiguration.cc:240:61:  [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 *language_env = getenv("LANGUAGE") == 0 ? "" : getenv("LANGUAGE");
data/apt-2.1.12/apt-pkg/aptconfiguration.cc:462:29:  [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.
	std::string profiles_env = getenv("DEB_BUILD_PROFILES") == 0 ? "" : getenv("DEB_BUILD_PROFILES");
data/apt-2.1.12/apt-pkg/aptconfiguration.cc:462:70:  [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.
	std::string profiles_env = getenv("DEB_BUILD_PROFILES") == 0 ? "" : getenv("DEB_BUILD_PROFILES");
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:111:14:  [3] (misc) chroot:
  chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22).
  Make sure the program immediately chdir("/"), closes file descriptors, and
  drops root privileges, and that all necessary files (and no more!) are in
  the new root.
         if (chroot(_config->FindDir("DPkg::Chroot-Directory","/").c_str()) != 0)
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:763:14:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
   char *p = realpath(File.c_str(), NULL);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:3098: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 *tmpdir = getenv(env);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:3415:23:  [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.
	 auto const tmpdir = getenv(env);
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:1026:15:  [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 *tz = getenv("TZ");
data/apt-2.1.12/apt-pkg/deb/debsystem.cc:158:11:  [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 (getenv("SUDO_USER") != NULL)
data/apt-2.1.12/apt-pkg/deb/debsystem.cc:401:8:  [3] (misc) chroot:
  chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22).
  Make sure the program immediately chdir("/"), closes file descriptors, and
  drops root privileges, and that all necessary files (and no more!) are in
  the new root.
   if (chroot(chrootDir.c_str()) != 0)
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:73:11:  [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 (getenv(Key) != nullptr)
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:75: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.
         int uid = atoi(getenv(Key));
data/apt-2.1.12/apt-pkg/init.cc:217:22:  [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 *Cfg = getenv("APT_CONFIG");
data/apt-2.1.12/apt-private/private-install.cc:552:11:  [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 (getenv("SUDO_USER") != nullptr)
data/apt-2.1.12/apt-private/private-install.cc:554: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.
	 auto const envsudocmd = getenv("SUDO_COMMAND");
data/apt-2.1.12/apt-private/private-install.cc:555: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.
	 auto const envshell = getenv("SHELL");
data/apt-2.1.12/apt-private/private-json-hooks.cc:203:8:  [3] (misc) chroot:
  chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22).
  Make sure the program immediately chdir("/"), closes file descriptors, and
  drops root privileges, and that all necessary files (and no more!) are in
  the new root.
   if (chroot(chrootDir.c_str()) != 0)
data/apt-2.1.12/apt-private/private-output.cc:70:16:  [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.
   auto cols = getenv("COLUMNS");
data/apt-2.1.12/apt-private/private-output.cc:685:22:  [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 * language = getenv("LANGUAGE");
data/apt-2.1.12/apt-private/private-utils.cc:30:13:  [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.
	 Args[0] = getenv("PAGER");
data/apt-2.1.12/apt-private/private-utils.cc:62:17:  [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.
      Args[0] = getenv("VISUAL");
data/apt-2.1.12/apt-private/private-utils.cc:66:17:  [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.
      Args[0] = getenv("EDITOR");
data/apt-2.1.12/apt-private/private-utils.cc:81:35:  [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.
   auto const source_date_epoch = getenv("SOURCE_DATE_EPOCH");
data/apt-2.1.12/cmdline/apt-dump-solver.cc:72:76:  [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 const * const filename = is_forwarding_dumper ? CmdL.FileList[0] : getenv("APT_EDSP_DUMP_FILENAME");
data/apt-2.1.12/ftparchive/writer.cc:149:20:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
       (RealPath = realpath(File,NULL)) != 0)
data/apt-2.1.12/ftparchive/writer.cc:194:23:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
      if ((RealPath = realpath(Dir.c_str(), nullptr)) == 0)
data/apt-2.1.12/ftparchive/writer.cc:233:23:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
      if ((RealPath = realpath(Dir.c_str(), nullptr)) == 0)
data/apt-2.1.12/ftparchive/writer.cc:823:16:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
	  (RealPath = realpath(OriginalPath.c_str(),NULL)) != 0)
data/apt-2.1.12/methods/aptmethod.h:307:11:  [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 (getenv("FAKED_MODE"))
data/apt-2.1.12/methods/ftp.cc:138: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.
		   char* result = getenv("ftp_proxy");
data/apt-2.1.12/methods/ftp.cc:144: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.
   if (getenv("no_proxy") != 0)
data/apt-2.1.12/methods/ftp.cc:146:43:  [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 (CheckDomainList(ServerName.Host,getenv("no_proxy")) == true)
data/apt-2.1.12/methods/ftp.cc:1167: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.
   if (getenv("ftp_proxy") != 0)
data/apt-2.1.12/methods/ftp.cc:1169:24:  [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.
      URI Proxy(string(getenv("ftp_proxy")));
data/apt-2.1.12/methods/ftp.cc:1176: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.
	 snprintf(S,sizeof(S),"http_proxy=%s",getenv("ftp_proxy"));
data/apt-2.1.12/methods/http.cc:455:23:  [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 *result = getenv("http_proxy");
data/apt-2.1.12/methods/http.cc:459:19:  [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 *result = getenv("https_proxy");
data/apt-2.1.12/methods/http.cc:469: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.
   if (getenv("no_proxy") != 0)
data/apt-2.1.12/methods/http.cc:471:43:  [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 (CheckDomainList(ServerName.Host,getenv("no_proxy")) == true)
data/apt-2.1.12/test/interactive-helper/aptwebserver.cc:951: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.
	 auto const home = getenv("HOME");
data/apt-2.1.12/test/libapt/fileutl_test.cc:244:32:  [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 const * const envtmp = getenv("TMPDIR");
data/apt-2.1.12/apt-pkg/acquire-item.cc:585: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.
		     char partial[Buf.st_size + 1];
data/apt-2.1.12/apt-pkg/acquire-item.cc:1817: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.
      auto const CheckReleaseInfo = [&](char const * const Type, bool const AllowChange, decltype(checkers[0].Getter) const Getter) {
data/apt-2.1.12/apt-pkg/acquire-item.cc:3642: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 tmpname[1000];
data/apt-2.1.12/apt-pkg/acquire-item.cc:4000:49:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
   std::unique_ptr<char, decltype(std::free) *> tmpfile { strdup(tmpfile_tpl.c_str()), std::free };
data/apt-2.1.12/apt-pkg/acquire-item.cc:4001:19:  [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 const fd = mkstemp(tmpfile.get());
data/apt-2.1.12/apt-pkg/acquire-item.cc:4001:27:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
   int const fd = mkstemp(tmpfile.get());
data/apt-2.1.12/apt-pkg/acquire-item.cc:4004:40:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
   RemoveFile("GetAuxFileNameFromURI", tmpfile.get());
data/apt-2.1.12/apt-pkg/acquire-worker.cc:426:44:  [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).
		  Log->Fetched(ReceivedHashes.FileSize(),atoi(LookupTag(Message,"Resume-Point","0").c_str()));
data/apt-2.1.12/apt-pkg/acquire-worker.cc:707: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 S[300];
data/apt-2.1.12/apt-pkg/acquire-worker.cc:716: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 S[300];
data/apt-2.1.12/apt-pkg/acquire.cc:576:22:  [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 const fd = open(filename.c_str(), O_RDONLY | O_CLOEXEC);
data/apt-2.1.12/apt-pkg/acquire.cc:592:52:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
      std::unique_ptr<char, decltype(std::free) *> tmpfile { strdup(tmpfile_tpl.c_str()), std::free };
data/apt-2.1.12/apt-pkg/acquire.cc:593:22:  [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 const fd = mkstemp(tmpfile.get());
data/apt-2.1.12/apt-pkg/acquire.cc:593:30:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
      int const fd = mkstemp(tmpfile.get());
data/apt-2.1.12/apt-pkg/acquire.cc:596:47:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
      RemoveFile("IsAccessibleBySandboxUser", tmpfile.get());
data/apt-2.1.12/apt-pkg/acquire.cc:792:22:  [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 const dirfd = open(Dir.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC);
data/apt-2.1.12/apt-pkg/algorithms.cc:556:4:  [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(OldScores.get(),Scores,sizeof(*Scores)*Size);
data/apt-2.1.12/apt-pkg/cachefilter-patterns.cc:498: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 Error[300];
data/apt-2.1.12/apt-pkg/cachefilter.cc:42: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 Error[300];
data/apt-2.1.12/apt-pkg/cacheset.cc:79: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 S[300];
data/apt-2.1.12/apt-pkg/cacheset.cc:101: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[length];
data/apt-2.1.12/apt-pkg/cdrom.cc:490: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[300];
data/apt-2.1.12/apt-pkg/clean.cc:46:22:  [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 const dirfd = open(Dir.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC);
data/apt-2.1.12/apt-pkg/contrib/arfile.cc:32: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 Name[16];
data/apt-2.1.12/apt-pkg/contrib/arfile.cc:33: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 MTime[12];
data/apt-2.1.12/apt-pkg/contrib/arfile.cc:34: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 UID[6];
data/apt-2.1.12/apt-pkg/contrib/arfile.cc:35: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 GID[6];
data/apt-2.1.12/apt-pkg/contrib/arfile.cc:36: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 Mode[8];
data/apt-2.1.12/apt-pkg/contrib/arfile.cc:37: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 Size[10];
data/apt-2.1.12/apt-pkg/contrib/arfile.cc:38: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 Magic[2];
data/apt-2.1.12/apt-pkg/contrib/arfile.cc:71: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 Magic[8];
data/apt-2.1.12/apt-pkg/contrib/arfile.cc:101: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 S[300];
data/apt-2.1.12/apt-pkg/contrib/cdromutl.cc:95:23:  [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 const null_fd = open("/dev/null",O_RDWR);
data/apt-2.1.12/apt-pkg/contrib/cdromutl.cc:146: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).
      int const null_fd = open("/dev/null",O_RDWR);
data/apt-2.1.12/apt-pkg/contrib/cdromutl.cc:158:9:  [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.
	 const char *Args[10];
data/apt-2.1.12/apt-pkg/contrib/cdromutl.cc:187: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).
   int dirfd = open(CD.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC);
data/apt-2.1.12/apt-pkg/contrib/cdromutl.cc:272: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(m->c_str(), "r");
data/apt-2.1.12/apt-pkg/contrib/cmndline.cc:93:25:  [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.
   FileList = new const char *[argc];
data/apt-2.1.12/apt-pkg/contrib/cmndline.cc:292: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[300];
data/apt-2.1.12/apt-pkg/contrib/cmndline.cc:393: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 cmdline[100 + argc * 50];
data/apt-2.1.12/apt-pkg/contrib/configuration.cc:490: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[16];
data/apt-2.1.12/apt-pkg/contrib/configuration.cc:491:59:  [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).
	 snprintf(buf, sizeof(buf)-1, "%d", FindI(key, Default ? atoi(Default) : 0 ));
data/apt-2.1.12/apt-pkg/contrib/configuration.cc:520: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 S[300];
data/apt-2.1.12/apt-pkg/contrib/configuration.cc:544: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 S[300];
data/apt-2.1.12/apt-pkg/contrib/configuration.cc:554: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 S[300];
data/apt-2.1.12/apt-pkg/contrib/configuration.cc:871: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(Buffer, Input.c_str(), Input.size() + 1);
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:43: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 Name[100];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:44: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 Mode[8];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:45: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 UserID[8];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:46: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 GroupID[8];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:47: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 Size[12];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:48: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 MTime[12];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:49: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 Checksum[8];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:51: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 LinkName[100];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:52: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 MagicNumber[8];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:53: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 UserName[32];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:54: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 GroupName[32];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:55: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 Major[8];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:56: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 Minor[8];      
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:126:16:  [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 Block[512];      
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:220:15:  [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 Block[512];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:239:15:  [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 Block[512];
data/apt-2.1.12/apt-pkg/contrib/extracttar.cc:274:12:  [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 Junk[32*1024];
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:251: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).
   int FD = open(File.c_str(),O_RDWR | O_CREAT | O_NOFOLLOW,0640);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:644: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 S[300];
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:715: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/apt-2.1.12/apt-pkg/contrib/fileutl.cc:874:15:  [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 fd = atoi(Opts->Value.c_str());
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:921:15:  [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 fd = atoi(ent->d_name);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:990:16:  [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* gpg = fopen(FileName.c_str(), "r");
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1076: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(to, buffer + bufferstart, requested_size);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1086: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(getend(), from, requested_size);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1219:17:  [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).
	 filefd->iFd = open(filefd->TemporaryFileName.c_str(), O_RDONLY);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1221:17:  [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).
	 filefd->iFd = open(filefd->FileName.c_str(), O_RDONLY);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1245: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[buffersize];
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1272: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 ignore[ignoresize];
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:2262:22:  [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 const nullfd = open("/dev/null", O_WRONLY);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:2547:17:  [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).
      if((iFd = mkstemp(name)) == -1)
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:2567: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).
      iFd = open(FileName.c_str(), fileflags, AccessMode);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:2802: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[buflen];
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:3158: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).
      fd = open(tempdir.c_str(), O_RDWR|O_TMPFILE|O_EXCL|O_CLOEXEC, 0600);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:3176:11:  [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).
	    fd = mkstemp(buffer.data());
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:3434: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).
   int const fd = open(File.c_str(), O_RDONLY | O_CLOEXEC | O_NOCTTY);
data/apt-2.1.12/apt-pkg/contrib/gpgv.cc:38: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).
   return {fopen(filename.c_str(), mode), &fclose};
data/apt-2.1.12/apt-pkg/contrib/gpgv.cc:203: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 statusfdstr[10];
data/apt-2.1.12/apt-pkg/contrib/gpgv.cc:232:15:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
	 std::string tmpfile;
data/apt-2.1.12/apt-pkg/contrib/gpgv.cc:233:13:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
	 strprintf(tmpfile, "%s/apt.conf.XXXXXX", GetTempDir().c_str());
data/apt-2.1.12/apt-pkg/contrib/gpgv.cc:234:21:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
	 conf.reset(strdup(tmpfile.c_str()));
data/apt-2.1.12/apt-pkg/contrib/gpgv.cc:240:20:  [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 confFd = mkstemp(conf.get());
data/apt-2.1.12/apt-pkg/contrib/gpgv.cc:372:26:  [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 const nullfd = open("/dev/null", O_WRONLY);
data/apt-2.1.12/apt-pkg/contrib/hashes.cc:364: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.
   unsigned char Buf[APT_BUFFER_SIZE];
data/apt-2.1.12/apt-pkg/contrib/hashes.cc:383: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.
   unsigned char Buf[APT_BUFFER_SIZE];
data/apt-2.1.12/apt-pkg/contrib/hashes.cc:409: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 Conv[16] =
data/apt-2.1.12/apt-pkg/contrib/hashes.cc:414: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 Result[((Size)*2) + 1];
data/apt-2.1.12/apt-pkg/contrib/hashes.h:32: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 const char * _SupportedHashes[10];
data/apt-2.1.12/apt-pkg/contrib/mmap.cc:432:4:  [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((char *)Base + Result, &LenToWrite, sizeof(LenToWrite));
data/apt-2.1.12/apt-pkg/contrib/mmap.cc:435:4:  [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((char *)Base + Result,String,Len);
data/apt-2.1.12/apt-pkg/contrib/mmap.cc:436:6:  [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 *)Base)[Result + Len] = 0;
data/apt-2.1.12/apt-pkg/contrib/progress.cc:156: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 S[300];
data/apt-2.1.12/apt-pkg/contrib/progress.cc:198: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 S[300];
data/apt-2.1.12/apt-pkg/contrib/proxy.cc:65: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 buf[512];
data/apt-2.1.12/apt-pkg/contrib/srvrec.cc:62: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.
   unsigned char answer[PACKETSZ];
data/apt-2.1.12/apt-pkg/contrib/srvrec.cc:97: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 buf[MAXDNAME];
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:313: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/apt-2.1.12/apt-pkg/contrib/strutl.cc:314: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 Tmp[3];
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:358: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/apt-2.1.12/apt-pkg/contrib/strutl.cc: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 Tmp[3];
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:583:11:  [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 tbl[64] = {'A','B','C','D','E','F','G','H',
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:600: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 Bits[3] = {0,0,0};
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:892: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[64000];
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:1155: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 S[30];
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:1158:4:  [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(S,Str,Len);
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:1182: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 S[30];
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:1185:4:  [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(S,Str,Len);
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:1582: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 tmp[3];
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:1751:11:  [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).
   Port = atoi(string(Host,Pos+1).c_str());
data/apt-2.1.12/apt-pkg/deb/debfile.cc:211:4:  [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(Control + Pos, Data,Size);
data/apt-2.1.12/apt-pkg/deb/debfile.cc:243:4:  [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(Control,Data,Size);
data/apt-2.1.12/apt-pkg/deb/deblistparser.cc:259: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 buf[32] = "Description-";
data/apt-2.1.12/apt-pkg/deb/deblistparser.cc:268: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(buf + prefixLen, lang->c_str(), lang->size());
data/apt-2.1.12/apt-pkg/deb/debsystem.cc:423:26:  [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 const nullfd = open("/dev/null", O_RDONLY);
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:75:20:  [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 uid = atoi(getenv(Key));
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:79: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 buf[255];
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:119: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 dpkgbuf[1024];
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:187: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 buf[32];
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:189: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.
      const char *Args[4];
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:484:9:  [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.
	 const char *Args[4];
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:543: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.
   unsigned char input_buf[256] = {0,}; 
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:558: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.
   unsigned char term_buf[1024] = {0,0, };
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:1017: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 timestr[200];
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:1026:21:  [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).
      d->term_out = fopen(logfile_name.c_str(),"a");
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:1050:24:  [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).
      d->history_out = fopen(history_name.c_str(),"a");
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:1108: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 timestr[200];
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:1246: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 slave_name[64];	// 64 is used by bionic
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:1299:36:  [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).
	    d->protect_slave_from_dying = open(d->slave, O_RDWR | O_CLOEXEC | O_NOCTTY);
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:1332: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).
   int const slaveFd = open(d->slave, O_RDWR | O_NOCTTY);
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:1772: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 status_fd_buf[20];
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2358: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 strbuf[255];
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2366:16:  [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).
      report = fopen(reportfile.c_str(),"r");
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2371:6:  [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 pkgname[255], version[255];
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2385: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).
   report = fopen(reportfile.c_str(),"w");
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2395: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 ctime_buf[26];	// need at least 26 bytes according to ctime(3)
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2412: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).
      log = fopen(logfile_name.c_str(),"r");
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2415: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[1024];
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2428:19:  [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* log = fopen(histfile_name.c_str(),"r");
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2431: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[1024];
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2465: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[1024];
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2480: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[1024];
data/apt-2.1.12/apt-pkg/dirstream.cc:38: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).
	 int iFd = open(Itm.Name,O_NDELAY|O_WRONLY|O_CREAT|O_TRUNC|O_APPEND,
data/apt-2.1.12/apt-pkg/edsp/edspsystem.cc:87: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 tmpname[300];
data/apt-2.1.12/apt-pkg/indexcopy.cc:95: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 S[400];
data/apt-2.1.12/apt-pkg/indexcopy.cc:534: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 S[400];
data/apt-2.1.12/apt-pkg/indexcopy.cc:692: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 S[400];
data/apt-2.1.12/apt-pkg/init.cc:81:18:  [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).
      tupletable.open(tuplepath);
data/apt-2.1.12/apt-pkg/init.cc:83:18:  [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).
      tupletable.open(tripletpath);
data/apt-2.1.12/apt-pkg/tagfile.cc:758: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 S[300];
data/apt-2.1.12/apt-pkg/tagfile.cc:800: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 S[100];
data/apt-2.1.12/apt-pkg/versionmatch.cc:85: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 Spec[300];
data/apt-2.1.12/apt-pkg/versionmatch.cc:86: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 *Fragments[20];
data/apt-2.1.12/apt-private/private-json-hooks.cc:366:9:  [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.
	 const char *Args[4];
data/apt-2.1.12/apt-private/private-output.cc:723: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 response[1024] = "";
data/apt-2.1.12/apt-private/private-output.cc:739: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 Error[300];
data/apt-2.1.12/apt-private/private-output.cc:765: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 Buf[1024];
data/apt-2.1.12/apt-private/private-show.cc:132: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 desctag[50];
data/apt-2.1.12/apt-private/private-show.cc:135:7:  [2] (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). Risk is low because the source is a constant string.
      strcpy(desctag, "\nDescription");
data/apt-2.1.12/apt-private/private-utils.cc:19: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.
      const char *Args[3];
data/apt-2.1.12/apt-private/private-utils.cc:56: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.
      const char *Args[3];
data/apt-2.1.12/cmdline/apt-extracttemplates.cc:149: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(Control + pos, data, size);
data/apt-2.1.12/cmdline/apt-extracttemplates.cc:152: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(Config + pos, data, size);
data/apt-2.1.12/cmdline/apt-extracttemplates.cc:155: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(Template + pos, data, size);
data/apt-2.1.12/cmdline/apt-helper.cc:124: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).
	 size_t const port = atoi(name.c_str() + found + 1);
data/apt-2.1.12/ftparchive/apt-ftparchive.cc:390:16:  [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 Buf[4096];
data/apt-2.1.12/ftparchive/cachedb.cc:76:20:  [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 ((err = Dbp->open(Dbp, NULL, DB.c_str(), NULL, DB_BTREE,
data/apt-2.1.12/ftparchive/cachedb.cc:85:18:  [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).
	     err = Dbp->open(Dbp, NULL, DB.c_str(), NULL, DB_HASH,
data/apt-2.1.12/ftparchive/cachedb.cc:403: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 buf[3];
data/apt-2.1.12/ftparchive/cachedb.h:37: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 TmpKey[600];
data/apt-2.1.12/ftparchive/contents.cc:84:4:  [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(StrPool,From,Len);
data/apt-2.1.12/ftparchive/contents.cc:223: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 Tmp[1024];
data/apt-2.1.12/ftparchive/contents.cc:264: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/apt-2.1.12/ftparchive/contents.cc:387:4:  [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(Data,NewData,Length);
data/apt-2.1.12/ftparchive/multicompress.cc:267: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.
   unsigned char Buffer[32*1024];
data/apt-2.1.12/ftparchive/override.cc:35: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.c_str(),"r");
data/apt-2.1.12/ftparchive/override.cc:39: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 Line[1000];
data/apt-2.1.12/ftparchive/override.cc:139: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.c_str(),"r");
data/apt-2.1.12/ftparchive/override.cc:143: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 Line[1000];
data/apt-2.1.12/ftparchive/sources.cc:43: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/apt-2.1.12/ftparchive/writer.cc:144: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 Jnk[2];
data/apt-2.1.12/ftparchive/writer.cc:240:17:  [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 *List = fopen(File.c_str(),"r");
data/apt-2.1.12/ftparchive/writer.cc:247: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 Line[1000];
data/apt-2.1.12/ftparchive/writer.cc:309:6:  [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 OldLink[400];
data/apt-2.1.12/ftparchive/writer.cc:670: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[Bins.length() + 1];
data/apt-2.1.12/ftparchive/writer.cc:677: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 *BinList[400];
data/apt-2.1.12/ftparchive/writer.cc:820: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 Jnk[2];
data/apt-2.1.12/methods/aptmethod.h:222: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).
      ALLOW(open);
data/apt-2.1.12/methods/aptmethod.h:339:6:  [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[10];
data/apt-2.1.12/methods/basehttp.h:35: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 Code[360];
data/apt-2.1.12/methods/connect.cc:122: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 Name[NI_MAXHOST];
data/apt-2.1.12/methods/connect.cc:123: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 Service[NI_MAXSERV];
data/apt-2.1.12/methods/connect.cc:353: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 ServStr[300];
data/apt-2.1.12/methods/ftp.cc:422: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 Leader[4];
data/apt-2.1.12/methods/ftp.cc:467: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 S[400];
data/apt-2.1.12/methods/ftp.cc:469:4:  [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(S,"\r\n");
data/apt-2.1.12/methods/ftp.cc:552: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 Name[NI_MAXHOST];
data/apt-2.1.12/methods/ftp.cc:553: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 Service[NI_MAXSERV];
data/apt-2.1.12/methods/ftp.cc:565: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 Port[100];
data/apt-2.1.12/methods/ftp.cc:579: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 Port[100];
data/apt-2.1.12/methods/ftp.cc:581: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 Name[100];
data/apt-2.1.12/methods/ftp.cc:628:11:  [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).
   Port = atoi(string(List[2]+1,List[3]).c_str());
data/apt-2.1.12/methods/ftp.cc:630:15:  [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).
      Proto = atoi(string(List[0]+1,List[1]).c_str());
data/apt-2.1.12/methods/ftp.cc:636: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 PStr[100];
data/apt-2.1.12/methods/ftp.cc:650: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 Name[NI_MAXHOST];
data/apt-2.1.12/methods/ftp.cc:651: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 Service[NI_MAXSERV];
data/apt-2.1.12/methods/ftp.cc:804: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 Name[NI_MAXHOST];
data/apt-2.1.12/methods/ftp.cc:805: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 Service[NI_MAXSERV];
data/apt-2.1.12/methods/ftp.cc:806: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 Service2[NI_MAXSERV];
data/apt-2.1.12/methods/ftp.cc:822:28:  [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).
      unsigned long Port = atoi(Service);
data/apt-2.1.12/methods/ftp.cc:939: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.
   unsigned char Buffer[4096];
data/apt-2.1.12/methods/ftp.cc:1175: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 S[300];
data/apt-2.1.12/methods/ftp.h:23: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*10];
data/apt-2.1.12/methods/gpgv.cc:52: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 name[32];
data/apt-2.1.12/methods/gpgv.cc:85:13:  [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 id = atoi(Digest.c_str());
data/apt-2.1.12/methods/http.cc:175: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(Buf + (InP%Size),OutQueue.c_str() + StrPos,Sz);
data/apt-2.1.12/methods/http.cc:296: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, Buffer.data(), read);
data/apt-2.1.12/methods/rred.cc:103: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(dst, src, len);
data/apt-2.1.12/methods/rred.cc:352: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[BLOCK_SIZE];
data/apt-2.1.12/methods/rred.cc:363: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[BLOCK_SIZE];
data/apt-2.1.12/methods/rred.cc:376: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[BLOCK_SIZE];
data/apt-2.1.12/methods/rred.cc:396: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[BLOCK_SIZE];
data/apt-2.1.12/methods/rsh.cc:119: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.
      const char *Args[400];
data/apt-2.1.12/methods/rsh.cc:237: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 Tmp[1024];
data/apt-2.1.12/methods/rsh.cc:346: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.
   unsigned char Buffer[4096];
data/apt-2.1.12/methods/rsh.h:22: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*10];
data/apt-2.1.12/methods/store.cc:106:16:  [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 Buffer[4*1024];
data/apt-2.1.12/test/interactive-helper/aptwebserver.cc:213: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[500];
data/apt-2.1.12/test/interactive-helper/aptwebserver.cc:743: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 error[300];
data/apt-2.1.12/test/interactive-helper/mthdcat.cc:11: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[4096];
data/apt-2.1.12/test/interactive-helper/test_fileutl.cc:31: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[1024];
data/apt-2.1.12/test/libapt/fileutl_test.cc:56: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 readback[20]; \
data/apt-2.1.12/test/libapt/fileutl_test.cc:281: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 buf[1024];
data/apt-2.1.12/test/libapt/fileutl_test.cc:378: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[50];
data/apt-2.1.12/test/libapt/getlanguages_test.cc:25: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 const* env[2];
data/apt-2.1.12/test/libapt/getlanguages_test.cc:153: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 const* env[2];
data/apt-2.1.12/test/libapt/hashsums_test.cc:50: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 readback[2000];
data/apt-2.1.12/test/libapt/openmaybeclearsignedfile_test.cc:21: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[100];
data/apt-2.1.12/test/libapt/openmaybeclearsignedfile_test.cc:235: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[100];
data/apt-2.1.12/apt-pkg/acquire-item.cc:218:94:  [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).
      std::string const FinalReleasegpg = FinalInRelease.substr(0, FinalInRelease.length() - strlen("InRelease")) + "Release.gpg";
data/apt-2.1.12/apt-pkg/acquire-item.cc:1409:78:  [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).
	 TransactionManager->BaseURI = I->Desc.URI.substr(0, I->Desc.URI.length() - strlen("Release"));
data/apt-2.1.12/apt-pkg/acquire-item.cc:1480:59:  [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).
	 FinalRelease = FinalFile.substr(0, FinalFile.length() - strlen("InRelease")) + "Release";
data/apt-2.1.12/apt-pkg/acquire-item.cc:1484:61:  [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).
	 FinalInRelease = FinalFile.substr(0, FinalFile.length() - strlen("Release")) + "InRelease";
data/apt-2.1.12/apt-pkg/acquire-item.cc:1716: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).
	 std::string const proto = Target.URI.substr(0, strlen("file:/"));
data/apt-2.1.12/apt-pkg/acquire-item.cc:1985: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).
	  (strncmp(failreason.c_str(), httperror, strlen(httperror)) == 0 &&
data/apt-2.1.12/apt-pkg/acquire-item.cc:2060:67:  [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).
      Desc.URI = DataTarget.URI.substr(0, DataTarget.URI.size() - strlen("InRelease")) + InReleasePath;
data/apt-2.1.12/apt-pkg/acquire-item.cc:3800: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).
   if (Component != NULL && strlen(Component) != 0)
data/apt-2.1.12/apt-pkg/acquire-method.cc:345:26:  [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 Length = strlen("Config-Item");
data/apt-2.1.12/apt-pkg/acquire.cc:89:32:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
      mode_t const old_umask = umask(S_IWGRP | S_IWOTH);
data/apt-2.1.12/apt-pkg/acquire.cc:92:7:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
      umask(old_umask);
data/apt-2.1.12/apt-pkg/cacheset.cc:102:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(buf, start, length);
data/apt-2.1.12/apt-pkg/cacheset.cc:358:26:  [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_t const alength = strlen(mod->Alias);
data/apt-2.1.12/apt-pkg/cacheset.cc:403:26:  [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_t const alength = strlen(mod->Alias);
data/apt-2.1.12/apt-pkg/cdrom.cc:127:43:  [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(Dir->d_name, "Translation-", strlen("Translation-")) != 0)
data/apt-2.1.12/apt-pkg/cdrom.cc:288: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).
      Start += strlen("/Translation-");
data/apt-2.1.12/apt-pkg/cdrom.cc:826:24:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
   mode_t const mode = umask(S_IWGRP | S_IWOTH);
data/apt-2.1.12/apt-pkg/cdrom.cc:829:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
   umask(mode);
data/apt-2.1.12/apt-pkg/contrib/cmndline.cc:230:14:  [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).
      Opt += strlen(Opt);
data/apt-2.1.12/apt-pkg/contrib/cmndline.cc:274:13:  [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).
	    Opt += strlen(Opt);
data/apt-2.1.12/apt-pkg/contrib/cmndline.cc:298:7:  [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 (strlen(argv[I]) >= sizeof(Buffer))
data/apt-2.1.12/apt-pkg/contrib/cmndline.cc:309:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	    strncpy(Buffer,J,JEnd - J);
data/apt-2.1.12/apt-pkg/contrib/cmndline.cc:325:13:  [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).
	    Opt += strlen(Opt);
data/apt-2.1.12/apt-pkg/contrib/configuration.cc:285:30:  [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 *End = Start + strlen(Name);
data/apt-2.1.12/apt-pkg/contrib/configuration.cc:925:26:  [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).
	      strcmp(string(I,I+strlen("#x-apt-configure-index")).c_str(), "#x-apt-configure-index") != 0))
data/apt-2.1.12/apt-pkg/contrib/configuration.cc:1032:10:  [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 (strlen(Pos) != 0)
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:648:23:  [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 Len = strlen(S);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:787: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).
      file.erase(strlen("/dev/null"));
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1024:25:  [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 (getuid() == 0 && strlen(user) != 0 && strlen(group) != 0) // if we aren't root, we can't chown, so don't try it
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1024:46:  [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 (getuid() == 0 && strlen(user) != 0 && strlen(group) != 0) // if we aren't root, we can't chown, so don't try it
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1072:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   ssize_t read(void *to, unsigned long long requested_size) APT_MUSTCHECK
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1150:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	 return buffer.read(To, Size);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1185:42:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	 unsigned long long actualread = buffer.read(To,
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1275:41:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	 if (filefd->Read(ignore, ignoresize, &read) == false)
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1280:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      } while(read != 0);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1533:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if (read(filefd->iFd, &size, 4) != 4)
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1669:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	    unsigned long long read;
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1672:64:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	    if (backend.Read(lz4_buffer.getend(), lz4_buffer.free(), &read) == false)
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1674:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	    lz4_buffer.bufferend += read;
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1827:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	    unsigned long long read;
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1830:66:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	    if (backend.Read(zstd_buffer.getend(), zstd_buffer.free(), &read) == false)
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:1832:31:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	    zstd_buffer.bufferend += read;
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:2305:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      return read(filefd->iFd, To, Size);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:2334:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      return read(filefd->iFd, To, Size);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:2558:35:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
      mode_t const CurrentUmask = umask(0);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:2559:7:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
      umask(CurrentUmask);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:2765:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      Res = read(Fd, To, Size);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:2808:13:  [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 = strlen(buffer);
data/apt-2.1.12/apt-pkg/contrib/fileutl.cc:3106: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).
   if (!tmpdir || strlen(tmpdir) == 0 || // tmpdir is set
data/apt-2.1.12/apt-pkg/contrib/gpgv.cc:158: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).
      if (not FileFd::Write(fd[1], errtag, strlen(errtag)) ||
data/apt-2.1.12/apt-pkg/contrib/gpgv.cc:304: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).
	 FileFd::Write(fd[1], errtag, strlen(errtag));
data/apt-2.1.12/apt-pkg/contrib/gpgv.cc:310:18:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	    auto ptag = fgetc(detached.get());
data/apt-2.1.12/apt-pkg/contrib/hashes.cc:370:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      ssize_t const Res = read(Fd,Buf,n);
data/apt-2.1.12/apt-pkg/contrib/hashes.h:177:62:  [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 Add(reinterpret_cast<unsigned char const *>(Data),strlen(Data));};
data/apt-2.1.12/apt-pkg/contrib/mmap.cc:418:13:  [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 = strlen(String);
data/apt-2.1.12/apt-pkg/contrib/progress.cc:224:26:  [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).
   for (unsigned int I = strlen(S); I < LastLen; I++)
data/apt-2.1.12/apt-pkg/contrib/progress.cc:227:14:  [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).
   LastLen = strlen(S);
data/apt-2.1.12/apt-pkg/contrib/string_view.h:39:55:  [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).
    StringView(const char *data) : data_(data), size_(strlen(data)) {}
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:237:25:  [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 *End = String + strlen(String) - 1;
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:274: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).
      memmove(I + Len,I + 1,strlen(I) + 1);
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:360:8:  [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 (strlen(String) >= sizeof(Buffer))
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:899:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int const Res = read(Fd, Buffer, sizeof(Buffer));
data/apt-2.1.12/apt-pkg/contrib/strutl.cc:1289:25:  [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 *Stop = Start + strlen(Start);
data/apt-2.1.12/apt-pkg/contrib/strutl.h:149:72:  [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).
inline APT_PURE int name(const char *A,const char *B) {return func(A,A+strlen(A),B,B+strlen(B));} \
data/apt-2.1.12/apt-pkg/contrib/strutl.h:149:86:  [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).
inline APT_PURE int name(const char *A,const char *B) {return func(A,A+strlen(A),B,B+strlen(B));} \
data/apt-2.1.12/apt-pkg/contrib/strutl.h:150: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).
inline APT_PURE int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));} \
data/apt-2.1.12/apt-pkg/contrib/strutl.h:151:110:  [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).
inline APT_PURE int name(const std::string& A,const char *B) {return func(A.c_str(),A.c_str()+A.length(),B,B+strlen(B));} \
data/apt-2.1.12/apt-pkg/contrib/strutl.h:156: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).
inline APT_PURE int name(const char *A,const char *AEnd,const char *B) {return func(A,AEnd,B,B+strlen(B));} \
data/apt-2.1.12/apt-pkg/contrib/strutl.h:157:97:  [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).
inline APT_PURE int name(const std::string& A,const char *B) {return func(A.begin(),A.end(),B,B+strlen(B));} \
data/apt-2.1.12/apt-pkg/contrib/strutl.h:177:138:  [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).
inline APT_PURE int stringcmp(std::string::const_iterator A,std::string::const_iterator Aend,const char *B) {return stringcmp(A,Aend,B,B+strlen(B));}
data/apt-2.1.12/apt-pkg/contrib/strutl.h:178:146:  [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).
inline APT_PURE int stringcasecmp(std::string::const_iterator A,std::string::const_iterator Aend,const char *B) {return stringcasecmp(A,Aend,B,B+strlen(B));}
data/apt-2.1.12/apt-pkg/deb/debmetaindex.cc:794:23:  [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(URI.substr(0,strlen("cdrom:")) == "cdrom:")
data/apt-2.1.12/apt-pkg/deb/debmetaindex.cc:1109:27:  [1] (buffer) mismatch:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
      auto const m = std::mismatch(KeysA.begin(), KeysA.end(), KeysB.begin());
data/apt-2.1.12/apt-pkg/deb/debversion.cc:272: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).
   unsigned Last = strlen(Ver);
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:97:13:  [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 (*envp++) + 1;
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:544:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   ssize_t len = read(STDIN_FILENO, input_buf, sizeof(input_buf));
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:560:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   ssize_t len=read(master, term_buf, sizeof(term_buf));
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:964:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      auto const len = read(statusfd, &d->dpkgbuf[d->dpkgbuf_pos], remainingBuffer);
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:1768:46:  [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).
#define ADDARG(X) Args.push_back(X); Size += strlen(X)
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2018:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	    while (read(STDIN_FILENO,&dummy,1) == 1);
data/apt-2.1.12/apt-pkg/deb/dpkgpm.cc:2372:9:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
	    if(sscanf(strbuf, "Package: %254s %254s", pkgname, version) == 2)
data/apt-2.1.12/apt-pkg/edsp.cc:494:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((data = read(input, &one, sizeof(one))) != -1) {
data/apt-2.1.12/apt-pkg/indexcopy.cc:348:24:  [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 (Path.length() < strlen("dists/"))
data/apt-2.1.12/apt-pkg/indexcopy.cc:352: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).
   if (stringcmp(Path.c_str(),Path.c_str()+strlen("dists/"),"dists/") != 0)
data/apt-2.1.12/apt-pkg/indexcopy.cc:356:30:  [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).
   string::size_type Slash = strlen("dists/");
data/apt-2.1.12/apt-pkg/indexcopy.cc:377:46:  [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(Binary.c_str(), "binary-", strlen("binary-")) == 0)
data/apt-2.1.12/apt-pkg/indexcopy.cc:379: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).
	 Binary.erase(0, strlen("binary-"));
data/apt-2.1.12/apt-pkg/init.cc:218: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).
   if (Cfg != 0 && strlen(Cfg) != 0)
data/apt-2.1.12/apt-pkg/pkgcachegen.cc:403:26:  [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).
	       VerStr, VerStr + strlen(VerStr));
data/apt-2.1.12/apt-pkg/tagfile.cc:761:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy(S,Start,Stop-Start);
data/apt-2.1.12/apt-pkg/tagfile.cc:803:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy(S,Start,Stop-Start);
data/apt-2.1.12/apt-pkg/tagfile.cc:979:26:  [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_t const TagLen = strlen(Tag);
data/apt-2.1.12/apt-pkg/tagfile.cc:1031: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).
	       if (fieldnamelen == strlen(Order[I]) && strncasecmp(fieldname, Order[I], fieldnamelen) == 0)
data/apt-2.1.12/apt-pkg/tagfile.cc:1062:86:  [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 (strncasecmp(name.c_str(), Order[I], name.length()) == 0 && name.length() == strlen(Order[I]))
data/apt-2.1.12/apt-pkg/versionmatch.cc:97:7:  [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 (strlen(Fragments[J]) < 3)
data/apt-2.1.12/apt-pkg/versionmatch.cc:143:26:  [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 *Ae = Ab + strlen(A);
data/apt-2.1.12/apt-pkg/versionmatch.cc:205:23:  [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_t length = strlen(pattern);
data/apt-2.1.12/apt-private/acqprogress.cc:324:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int len = read(STDIN_FILENO,&C,1);
data/apt-2.1.12/apt-private/private-cmndline.cc:318:81:  [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 (CmdMatches("minimize-manual") || (Cmd != nullptr && strncmp(Cmd, "show", strlen("show")) != 0))
data/apt-2.1.12/apt-private/private-install.cc:1050:25:  [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).
	    pkgname.replace(0, strlen("builddeps"), "src");
data/apt-2.1.12/apt-private/private-output.cc:392: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).
	    for (unsigned J = 0; J != strlen(End.DepType()) + 3; J++)
data/apt-2.1.12/apt-private/private-output.cc:729:8:  [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 (strlen(response) == 0)
data/apt-2.1.12/apt-private/private-show.cc:50:26:  [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_t const TagLen = strlen(TagName);
data/apt-2.1.12/apt-private/private-show.cc:69:26:  [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_t const TagLen = strlen(TagName);
data/apt-2.1.12/apt-private/private-show.cc:151:38:  [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(Start, desctag + 1, strlen(desctag) - 1) != 0)
data/apt-2.1.12/apt-private/private-show.cc:153:15:  [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).
	    Start += strlen(desctag) - 1;
data/apt-2.1.12/apt-private/private-show.cc:201: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).
	 DescP = skipDescription(End + strlen("Description"), Length - (End - Buffer), true);
data/apt-2.1.12/apt-private/private-source.cc:358:10:  [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).
	 pos += strlen("\nVcs-");
data/apt-2.1.12/apt-private/private-source.cc:691:30:  [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 *Stop = Start + strlen(Start);
data/apt-2.1.12/apt-private/private-source.cc:713:15:  [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).
	    Start += strlen("Conflicts:");
data/apt-2.1.12/cmdline/apt-cache.cc:307:15:  [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(Cache->StrP + *i) + 1;
data/apt-2.1.12/cmdline/apt-cache.cc:991:41:  [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(I.Name(),CmdL.FileList[1],strlen(CmdL.FileList[1])) == 0)
data/apt-2.1.12/cmdline/apt-cdrom.cc:59:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   if (read(STDIN_FILENO,&C,1) < 0)
data/apt-2.1.12/cmdline/apt-config.cc:48:24:  [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 (I[1] == 0 || strlen(I[1]) == 0)
data/apt-2.1.12/cmdline/apt-dump-solver.cc:73: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).
   if (filename == nullptr || strlen(filename) == 0)
data/apt-2.1.12/cmdline/apt-extracttemplates.cc:237: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).
      f.Write(data, strlen(data));
data/apt-2.1.12/cmdline/apt-mark.cc:375: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 (strncasecmp(CmdL.FileList[0], "showpurge", strlen("showpurge")) == 0)
data/apt-2.1.12/cmdline/apt-mark.cc:377:60:  [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).
   else if (strncasecmp(CmdL.FileList[0], "showdeinstall", strlen("showdeinstall")) == 0 ||
data/apt-2.1.12/cmdline/apt-mark.cc:378:47:  [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).
	 strncasecmp(CmdL.FileList[0], "showremove", strlen("showremove")) == 0)
data/apt-2.1.12/cmdline/apt-mark.cc:380:55:  [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).
   else if (strncasecmp(CmdL.FileList[0], "showhold", strlen("showhold")) == 0 || strncasecmp(CmdL.FileList[0], "showheld", strlen("showheld")) == 0)
data/apt-2.1.12/cmdline/apt-mark.cc:380:125:  [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).
   else if (strncasecmp(CmdL.FileList[0], "showhold", strlen("showhold")) == 0 || strncasecmp(CmdL.FileList[0], "showheld", strlen("showheld")) == 0)
data/apt-2.1.12/ftparchive/contents.cc:72:23:  [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 Len = strlen(From) + 1;
data/apt-2.1.12/ftparchive/contents.cc:224:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(Tmp,Start,I - Start);
data/apt-2.1.12/ftparchive/contents.cc:277:25:  [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 *OldEnd = Buf + strlen(Buf);
data/apt-2.1.12/ftparchive/contents.cc:283: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).
      if (Top->Path[strlen(Top->Path)-1] != '/' /*|| Top->Dups == 0*/)
data/apt-2.1.12/ftparchive/contents.cc:332:24:  [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 long Len = strlen(Itm.Name);
data/apt-2.1.12/ftparchive/multicompress.cc:273:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int Res = read(FD,Buffer,sizeof(Buffer));
data/apt-2.1.12/ftparchive/override.cc:107: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).
	 if (*End == 0 || strlen(End) < 4)
data/apt-2.1.12/ftparchive/writer.cc:262: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).
	    memmove(FileStart,FileName,strlen(FileStart));
data/apt-2.1.12/methods/aptmethod.h:233:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      ALLOW(read);
data/apt-2.1.12/methods/aptmethod.h:268:13:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
      ALLOW(umask);
data/apt-2.1.12/methods/aptmethod.h:355: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).
	    write(2, str1, strlen(str1));
data/apt-2.1.12/methods/aptmethod.h:357: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).
	    write(2, str2, strlen(str2));
data/apt-2.1.12/methods/aptmethod.h:358:28:  [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).
	    write(2, COMMON_ARCH, strlen(COMMON_ARCH));
data/apt-2.1.12/methods/aptmethod.h:359: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).
	    write(2, str3, strlen(str3));
data/apt-2.1.12/methods/connect.cc:90:66:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   ssize_t Read(void *buf, size_t count) APT_OVERRIDE { return ::read(fd, buf, count); }
data/apt-2.1.12/methods/ftp.cc:423:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy(Leader,Msg.c_str(),3);
data/apt-2.1.12/methods/ftp.cc:476:24:  [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 long Len = strlen(S);
data/apt-2.1.12/methods/ftp.cc:950:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int Res = read(DataFd,Buffer,sizeof(Buffer));
data/apt-2.1.12/methods/gpgv.cc:101: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).
   if (goodsig.length() == 40 + strlen("GOODSIG "))
data/apt-2.1.12/methods/gpgv.cc:102:47:  [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 validsig.compare(0, 40, goodsig, strlen("GOODSIG "), 40) == 0;
data/apt-2.1.12/methods/gpgv.cc:103:45:  [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 validsig.compare(24, 16, goodsig, strlen("GOODSIG "), 16) == 0;
data/apt-2.1.12/methods/gpgv.cc:217:27:  [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 errsig.compare(strlen("ERRSIG "), 16, buffer, sizeof(GNUPGNOPUBKEY), 16) == 0;  }), ErrSigners.end());
data/apt-2.1.12/methods/http.cc:118:6:  [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(tickLen.count());
data/apt-2.1.12/methods/http.cc:296:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	 memcpy(buf, Buffer.data(), read);
data/apt-2.1.12/methods/http.cc:297:49:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	 Buffer.erase(Buffer.begin(), Buffer.begin() + read);
data/apt-2.1.12/methods/http.cc:298:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	 return read;
data/apt-2.1.12/methods/mirror.cc:328:28:  [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).
	       uristr.erase(plus, strlen("mirror") + 1);
data/apt-2.1.12/methods/mirror.cc:336:24:  [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).
	    uristr.replace(0, strlen("mirror"), "http");
data/apt-2.1.12/methods/rfc2553emu.cc:48:26:  [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 (End != servname + strlen(servname))
data/apt-2.1.12/methods/rfc2553emu.cc:189:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	    strncpy(host,Ent->h_name,hostlen);
data/apt-2.1.12/methods/rfc2553emu.cc:208:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	 strncpy(host,inet_ntoa(sin->sin_addr),hostlen);
data/apt-2.1.12/methods/rfc2553emu.cc:224:6:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	    strncpy(serv,Ent->s_name,servlen);
data/apt-2.1.12/methods/rred.cc:367: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).
	 size_t const l = strlen(buffer);
data/apt-2.1.12/methods/rred.cc:380: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).
	 size_t const l = strlen(buffer);
data/apt-2.1.12/methods/rred.cc:467:13:  [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).
	       l = strlen(buffer);
data/apt-2.1.12/methods/rsh.cc:214:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int Res = read(ReadFd,Buffer + Len,sizeof(Buffer) - Len);
data/apt-2.1.12/methods/rsh.cc:250:24:  [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 long Len = strlen(S);
data/apt-2.1.12/methods/rsh.cc:357:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int Res = read(ReadFd,Buffer,sizeof(Buffer));
data/apt-2.1.12/test/interactive-helper/aptwebserver.cc:226: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).
	 Success &= FileFd::Write(client, "\r\n", strlen("\r\n"));
data/apt-2.1.12/test/interactive-helper/aptwebserver.cc:234: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).
      Success &= FileFd::Write(client, finish, strlen(finish));
data/apt-2.1.12/test/interactive-helper/aptwebserver.cc:251:36:  [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).
	    FileFd::Write(client, finish, strlen(finish)) == false)
data/apt-2.1.12/test/interactive-helper/aptwebserver.cc:329: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 (strncmp("/home/", uri.c_str(), strlen("/home/")) == 0 && uri.find("/public_html/") != std::string::npos)
data/apt-2.1.12/test/interactive-helper/aptwebserver.cc:513:36:  [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(auth.c_str(), basic, strlen(basic)) == 0)
data/apt-2.1.12/test/interactive-helper/aptwebserver.cc:515: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).
	    auth.erase(0, strlen(basic));
data/apt-2.1.12/test/interactive-helper/aptwebserver.cc:552:36:  [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(auth.c_str(), basic, strlen(basic)) == 0)
data/apt-2.1.12/test/interactive-helper/aptwebserver.cc:554: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).
	    auth.erase(0, strlen(basic));
data/apt-2.1.12/test/interactive-helper/libnoprofile.c:10: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).
    if (strncmp(format, "profiling:", strlen("profiling:")) == 0)
data/apt-2.1.12/test/interactive-helper/libnoprofile.c:28: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).
    if (strncmp(format, "profiling:", strlen("profiling:")) == 0)
data/apt-2.1.12/test/interactive-helper/mthdcat.cc:15:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      int Res = read(STDIN_FILENO,Buffer,sizeof(Buffer));
data/apt-2.1.12/test/interactive-helper/rpmver.cc:25:27:  [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).
    str1 = (char *)alloca(strlen(a) + 1);
data/apt-2.1.12/test/interactive-helper/rpmver.cc:26:27:  [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).
    str2 = (char *)alloca(strlen(b) + 1);
data/apt-2.1.12/test/interactive-helper/rpmver.cc:77:10:  [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 (strlen(one) > strlen(two)) return 1;
data/apt-2.1.12/test/interactive-helper/rpmver.cc:77:24:  [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 (strlen(one) > strlen(two)) return 1;
data/apt-2.1.12/test/interactive-helper/rpmver.cc:78:10:  [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 (strlen(two) > strlen(one)) return -1;
data/apt-2.1.12/test/interactive-helper/rpmver.cc:78:24:  [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 (strlen(two) > strlen(one)) return -1;
data/apt-2.1.12/test/interactive-helper/rpmver.cc:110:38:  [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).
	  debVS.CmpFragment(argv[1],argv[1]+strlen(argv[1]),
data/apt-2.1.12/test/interactive-helper/rpmver.cc:111:24:  [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).
			    argv[2],argv[2]+strlen(argv[2])));
data/apt-2.1.12/test/interactive-helper/rpmver.cc:115:38:  [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).
	  debVS.CmpFragment(argv[2],argv[2]+strlen(argv[2]),
data/apt-2.1.12/test/interactive-helper/rpmver.cc:116:24:  [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).
			    argv[1],argv[1]+strlen(argv[1])));
data/apt-2.1.12/test/libapt/file-helpers.cc:63:37:  [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).
      EXPECT_TRUE(fd.Write(content, strlen(content)));
data/apt-2.1.12/test/libapt/fileutl_test.cc:30:4:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
   umask(a_umask);
data/apt-2.1.12/test/libapt/fileutl_test.cc:34:14:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
   EXPECT_EQ(umask(a_umask), a_umask);
data/apt-2.1.12/test/libapt/fileutl_test.cc:60:41:  [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).
   EXPECT_EQ(0, strncmp(expect, actual, strlen(expect)));
data/apt-2.1.12/test/libapt/fileutl_test.cc:70:36:  [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).
      EXPECT_TRUE(f.Read(readback, strlen(expect)));
data/apt-2.1.12/test/libapt/fileutl_test.cc:74: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).
      EXPECT_EQ(strlen(expect), f.Tell());
data/apt-2.1.12/test/libapt/fileutl_test.cc:79:53:  [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).
      EXPECT_TRUE(f.Skip((test.size() - f.Tell()) - strlen(expect)));
data/apt-2.1.12/test/libapt/fileutl_test.cc:80:36:  [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).
      EXPECT_TRUE(f.Read(readback, strlen(expect)));
data/apt-2.1.12/test/libapt/fileutl_test.cc:92:36:  [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).
      EXPECT_TRUE(f.Read(readback, strlen(expect)));
data/apt-2.1.12/test/libapt/fileutl_test.cc:145:28:  [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).
      f.ReadLine(readback, strlen(expect) + 1);
data/apt-2.1.12/test/libapt/fileutl_test.cc:149: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).
      EXPECT_EQ(strlen(expect), f.Tell());
data/apt-2.1.12/test/libapt/parsedepends_test.cc:50: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).
   const char* End = Depends + strlen(Depends);
data/apt-2.1.12/test/libapt/srvrecs_test.cc:81:25:  [1] (buffer) equal:
  Function does not check the second iterator for over-read conditions
  (CWE-126). This function is often discouraged by most C++ coding standards
  in favor of its safer alternatives provided since C++14. Consider using a
  form of this function that checks the second iterator before potentially
  overflowing it.
      EXPECT_FALSE(std::equal(first_pull.begin(), first_pull.end(), second_pull.begin()));
data/apt-2.1.12/test/libapt/strutil_test.cc:201: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).
      fd.Write(ab, strlen(ab));
data/apt-2.1.12/test/libapt/strutil_test.cc:207:37:  [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).
      fd.Seek((msgsize + (i - 1)) * strlen(ab));
data/apt-2.1.12/test/libapt/strutil_test.cc:208: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).
      fd.Write(ab, strlen(ab));
data/apt-2.1.12/test/libapt/strutil_test.cc:209: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).
      fd.Write(nl, strlen(nl));
data/apt-2.1.12/test/libapt/strutil_test.cc:214: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).
      EXPECT_EQ((msgsize + i) * strlen(ab), list[0].length());
data/apt-2.1.12/test/libapt/strutil_test.cc:220: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).
   fd.Write(nl, strlen(nl));
data/apt-2.1.12/test/libapt/strutil_test.cc:224: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).
   EXPECT_EQ((msgsize + 20) * strlen(ab), list[0].length());

ANALYSIS SUMMARY:

Hits = 575
Lines analyzed = 88784 in approximately 2.56 seconds (34737 lines/second)
Physical Source Lines of Code (SLOC) = 65573
Hits@level = [0] 132 [1] 200 [2] 244 [3]  42 [4]  68 [5]  21
Hits@level+ = [0+] 707 [1+] 575 [2+] 375 [3+] 131 [4+]  89 [5+]  21
Hits/KSLOC@level+ = [0+] 10.7819 [1+] 8.76885 [2+] 5.71882 [3+] 1.99777 [4+] 1.35727 [5+] 0.320254
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.