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/heimdall-flash-1.4.2+dfsg/cmake/LargeFiles.c
Examining data/heimdall-flash-1.4.2+dfsg/cmake/LargeFiles64.c
Examining data/heimdall-flash-1.4.2+dfsg/cmake/LargeFilesWindows.c
Examining data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Alerts.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Alerts.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/FirmwareInfo.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/FirmwareInfo.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/PackageData.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/PackageData.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/aboutform.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/aboutform.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/main.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/mainwindow.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/mainwindow.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/Arguments.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/Arguments.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/BeginDumpPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/BeginSessionPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/BridgeManager.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/BridgeManager.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/ClosePcScreenAction.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/ClosePcScreenAction.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/ControlPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/DetectAction.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/DetectAction.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/DeviceTypePacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/DownloadPitAction.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/DownloadPitAction.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/DumpPartFileTransferPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/DumpPartPitFilePacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/DumpResponse.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/EnableTFlashPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/EndFileTransferPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/EndModemFileTransferPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/EndPhoneFileTransferPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/EndPitFileTransferPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/EndSessionPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/FilePartSizePacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/FileTransferPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/FlashAction.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/FlashAction.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/FlashPartFileTransferPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/FlashPartPitFilePacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/Heimdall.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/HelpAction.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/HelpAction.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/InboundPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/InfoAction.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/InfoAction.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/Interface.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/Interface.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/OutboundPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/Packet.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/PitFilePacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/PitFileResponse.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/PrintPitAction.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/PrintPitAction.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/ReceiveFilePartPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/ResponsePacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/SendFilePartPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/SendFilePartResponse.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/SessionSetupPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/SessionSetupResponse.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/SetupSessionPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/SetupSessionResponse.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/TotalBytesPacket.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/Utility.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/Utility.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/VersionAction.cpp
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/VersionAction.h
Examining data/heimdall-flash-1.4.2+dfsg/heimdall/source/main.cpp
Examining data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.cpp
Examining data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h

FINAL RESULTS:

data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:254:2:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
	strcpy(tarHeader.fields.name, utfFilename.constData());
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/mainwindow.cpp:925:8:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		flag.sprintf("--%u", fileInfos[i].GetPartitionId());
data/heimdall-flash-1.4.2+dfsg/heimdall/source/Interface.cpp:86:2:  [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/heimdall-flash-1.4.2+dfsg/heimdall/source/Interface.cpp:103:3:  [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, stdoutArgs);
data/heimdall-flash-1.4.2+dfsg/heimdall/source/Interface.cpp:109:2:  [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(stderr, format, stderrArgs);
data/heimdall-flash-1.4.2+dfsg/heimdall/source/Interface.cpp:124:3:  [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, stdoutArgs);
data/heimdall-flash-1.4.2+dfsg/heimdall/source/Interface.cpp:129:2:  [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(stderr, format, stderrArgs);
data/heimdall-flash-1.4.2+dfsg/heimdall/source/Interface.cpp:145:3:  [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, stdoutArgs);
data/heimdall-flash-1.4.2+dfsg/heimdall/source/Interface.cpp:151:2:  [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(stderr, format, stderrArgs);
data/heimdall-flash-1.4.2+dfsg/heimdall/source/Interface.cpp:166:3:  [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, stdoutArgs);
data/heimdall-flash-1.4.2+dfsg/heimdall/source/Interface.cpp:171:2:  [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(stderr, format, stderrArgs);
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h:214:6:  [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(this->partitionName, partitionName);
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h:230:6:  [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(this->flashFilename, flashFilename);
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h:246:6:  [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(this->fotaFilename, fotaFilename);
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/PackageData.cpp:49:13:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (!file->open(QFile::ReadOnly))
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:49:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (!tarFile.open())
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:125: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 fileSizeString[13];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:126: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(fileSizeString, tarHeader.fields.size, 12);
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:149: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).
				if (!outputFile->open())
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:160: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 readBuffer[TarHeader::kBlockReadCount * TarHeader::kBlockLength];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:231: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).
	if (!file.open(QFile::ReadOnly))
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:284:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(tarHeader.fields.mode, "%07o", mode);
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:290:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(tarHeader.fields.userId, "%07o", id);
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:292:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(tarHeader.fields.userId, "%07o", 0);
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:298:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(tarHeader.fields.groupId, "%07o", id);
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:300:3:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
		sprintf(tarHeader.fields.groupId, "%07o", 0);
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:303:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(tarHeader.fields.size, "%011llo", file.size());
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:304:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(tarHeader.fields.modifiedTime, "%u", qtFileInfo.lastModified().toTime_t());
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:316:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf(tarHeader.fields.checksum, "%07o", checksum);
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:321: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 buffer[TarHeader::kBlockWriteCount * TarHeader::kBlockLength];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:362: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).
	if (!firmwareXmlFile.open())
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:374: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).
	if (!tarFile->open())
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:478: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 emptyEntry[TarHeader::kBlockLength];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:491:32:  [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 *compressedPackageFile = fopen(packagePath.toStdString().c_str(), "rb");
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:507: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).
	if (!outputTar.open())
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:515: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 buffer[kExtractBufferLength];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:582:32:  [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 *compressedPackageFile = fopen(packagePath.toStdString().c_str(), "wb");
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:600:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (!tar.open())
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:612: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 buffer[kCompressBufferLength];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:67: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/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:68: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/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:69: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/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:70: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/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h: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 size[12];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:72: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 modifiedTime[12];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:73: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/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:75: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/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:76: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[6];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:77: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 version[2];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:78: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/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:79: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/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:80: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 devMajor[8];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:81: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 devMinor[8];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:82: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 prefix[155];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.h:85: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 buffer[kBlockLength];
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/mainwindow.cpp:125: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).
	if(!file->open(QIODevice::ReadOnly))
data/heimdall-flash-1.4.2+dfsg/heimdall/source/BridgeManager.cpp:129: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 stringBuffer[128];
data/heimdall-flash-1.4.2+dfsg/heimdall/source/BridgeManager.cpp:300: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.
	unsigned char dataBuffer[7];
data/heimdall-flash-1.4.2+dfsg/heimdall/source/BridgeManager.cpp:303:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(dataBuffer, "ODIN", 4);
data/heimdall-flash-1.4.2+dfsg/heimdall/source/BridgeManager.cpp:953: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(buffer + offset, receiveFilePartPacket->GetData(), receiveFilePartPacket->GetReceivedSize());
data/heimdall-flash-1.4.2+dfsg/heimdall/source/Heimdall.h:33:30:  [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).
#define FileOpen(FILE, MODE) fopen(FILE, MODE)
data/heimdall-flash-1.4.2+dfsg/heimdall/source/Heimdall.h:49:30:  [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).
#define FileOpen(FILE, MODE) fopen(FILE, MODE)
data/heimdall-flash-1.4.2+dfsg/heimdall/source/SendFilePartPacket.h:54:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
				memcpy(data, buffer, size);
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.cpp:195: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(data + entryOffset + 36, entries[i]->GetPartitionName(), PitEntry::kPartitionNameMaxLength);
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.cpp:196: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(data + entryOffset + 36 + PitEntry::kPartitionNameMaxLength, entries[i]->GetFlashFilename(), PitEntry::kFlashFilenameMaxLength);
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.cpp:197: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(data + entryOffset + 36 + PitEntry::kPartitionNameMaxLength + PitEntry::kFlashFilenameMaxLength,
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h:96: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 partitionName[kPartitionNameMaxLength];
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h:97: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 flashFilename[kFlashFilenameMaxLength]; // USB flash filename
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h:98: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 fotaFilename[kFotaFilenameMaxLength]; // Firmware over the air
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h:216: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(this->partitionName, partitionName, kPartitionNameMaxLength - 1);
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h:232: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(this->flashFilename, flashFilename, kFlashFilenameMaxLength - 1);
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h:248: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(this->fotaFilename, fotaFilename, kFotaFilenameMaxLength - 1);
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:63:29:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		qint64 dataRead = tarFile.read(tarHeader.buffer, TarHeader::kBlockLength);
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:168:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					qint64 dataRead = tarFile.read(readBuffer, fileDataToRead + (TarHeader::kBlockLength - fileDataToRead % TarHeader::kBlockLength) % TarHeader::kBlockLength);
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:326:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		qint64 dataRead = file.read(buffer, TarHeader::kBlockWriteCount * TarHeader::kBlockLength);
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/Packaging.cpp:622:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		bytesRead = tar.read(buffer, kCompressBufferLength);
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/mainwindow.cpp:130:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	file->read(reinterpret_cast<char *>(buffer), file->size());
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/mainwindow.cpp:657: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 (pitEntry && strlen(pitEntry->GetFlashFilename()) > 0)
data/heimdall-flash-1.4.2+dfsg/heimdall-frontend/source/mainwindow.cpp:739: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 (pitEntry && strlen(pitEntry->GetFlashFilename()) > 0)
data/heimdall-flash-1.4.2+dfsg/heimdall/source/Heimdall.h:47:18:  [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.
#define Sleep(t) usleep(1000*t)
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h:109:12:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
				return strlen(partitionName) != 0;
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h:213:9:  [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(partitionName) < kPartitionNameMaxLength)
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h:229:9:  [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(partitionName) < kFlashFilenameMaxLength)
data/heimdall-flash-1.4.2+dfsg/libpit/source/libpit.h:245:9:  [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(partitionName) < kFotaFilenameMaxLength)

ANALYSIS SUMMARY:

Hits = 84
Lines analyzed = 10895 in approximately 0.40 seconds (27159 lines/second)
Physical Source Lines of Code (SLOC) = 7046
Hits@level = [0]   7 [1]  12 [2]  58 [3]   0 [4]  14 [5]   0
Hits@level+ = [0+]  91 [1+]  84 [2+]  72 [3+]  14 [4+]  14 [5+]   0
Hits/KSLOC@level+ = [0+] 12.9151 [1+] 11.9217 [2+] 10.2186 [3+] 1.98694 [4+] 1.98694 [5+]   0
Dot directories skipped = 1 (--followdotdir overrides)
Minimum risk level = 1
Not every hit is necessarily a security vulnerability.
There may be other security vulnerabilities; review your code!
See 'Secure Programming HOWTO'
(https://dwheeler.com/secure-programs) for more information.