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/luksipc-0.04/chunk.h
Examining data/luksipc-0.04/exec.c
Examining data/luksipc-0.04/exec.h
Examining data/luksipc-0.04/exit.c
Examining data/luksipc-0.04/exit.h
Examining data/luksipc-0.04/globals.h
Examining data/luksipc-0.04/keyfile.c
Examining data/luksipc-0.04/keyfile.h
Examining data/luksipc-0.04/logging.c
Examining data/luksipc-0.04/logging.h
Examining data/luksipc-0.04/luks.c
Examining data/luksipc-0.04/luks.h
Examining data/luksipc-0.04/luksipc.c
Examining data/luksipc-0.04/luksipc.h
Examining data/luksipc-0.04/mount.c
Examining data/luksipc-0.04/mount.h
Examining data/luksipc-0.04/parameters.c
Examining data/luksipc-0.04/parameters.h
Examining data/luksipc-0.04/random.c
Examining data/luksipc-0.04/random.h
Examining data/luksipc-0.04/shutdown.c
Examining data/luksipc-0.04/shutdown.h
Examining data/luksipc-0.04/tests/prng/prng_crc64.c
Examining data/luksipc-0.04/utils.c
Examining data/luksipc-0.04/utils.h
Examining data/luksipc-0.04/chunk.c

FINAL RESULTS:

data/luksipc-0.04/exec.c:176: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(aArguments[0], argcopy);
data/luksipc-0.04/logging.c:56: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(stderr, aFmtString, ap);
data/luksipc-0.04/luks.c:182:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(aliasPathname, "/dev/mapper/%s", alias);
data/luksipc-0.04/luksipc.c:673: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, aMsg, argList);
data/luksipc-0.04/utils.c:51:3:  [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(aDest, aSrc);
data/luksipc-0.04/parameters.c:200:22:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
	while ((character = getopt_long(argc, argv, "hb:d:l:k:p:c:", longOptions, NULL)) != -1) {
data/luksipc-0.04/exec.c:143:3:  [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(aBuffer + aBufSize - 5, "...");
data/luksipc-0.04/exec.c:165: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 commandLineBuffer[256];
data/luksipc-0.04/keyfile.c:52: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).
	int fd = open(aFilename, O_WRONLY | O_CREAT | O_TRUNC, 0600);
data/luksipc-0.04/luks.c:72: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 userSuppliedArguments[MAX_ARGLENGTH];
data/luksipc-0.04/luks.c:73: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.
	const char *arguments[MAX_ARG_CNT] = {
data/luksipc-0.04/luks.c:135: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 mapperTable[256];
data/luksipc-0.04/luks.c:153: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 aliasDeviceFilename[256];
data/luksipc-0.04/luks.c:167: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 alias[64];
data/luksipc-0.04/luks.c:171:3:  [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(alias, "alias_");
data/luksipc-0.04/luksipc.c:69: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 writeDevicePath[48];
data/luksipc-0.04/luksipc.c:105: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 header[RESUME_FILE_HEADER_MAGIC_LEN];
data/luksipc-0.04/luksipc.c:106:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(header, RESUME_FILE_HEADER_MAGIC, RESUME_FILE_HEADER_MAGIC_LEN);
data/luksipc-0.04/luksipc.c:122: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 header[RESUME_FILE_HEADER_MAGIC_LEN];
data/luksipc-0.04/luksipc.c:354: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).
	aConvProcess->resumeFd = open(aParameters->resumeFilename, openFlags, 0600);
data/luksipc-0.04/luksipc.c:386:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	*aFd = open(aPath, aOpenFlags, 0600);
data/luksipc-0.04/luksipc.c:459: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).
	int readFd = open(aParameters->rawDevice, O_RDONLY);
data/luksipc-0.04/luksipc.c:466: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 writeFd = open(aParameters->backupFile, O_TRUNC | O_WRONLY | O_CREAT, 0600);
data/luksipc-0.04/luksipc.c:496:2:  [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(aConvProcess->writeDevicePath, "/dev/mapper/luksipc_");
data/luksipc-0.04/luksipc.c:810: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 yes[16];
data/luksipc-0.04/mount.c:37: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).
	FILE *f = fopen("/proc/mounts", "r");
data/luksipc-0.04/parameters.c:144: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 errorMessage[256];
data/luksipc-0.04/parameters.c:211:26:  [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).
				aParams->blocksize = atoi(optarg);
data/luksipc-0.04/random.c:52: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).
	FILE *f = fopen(randomDevice, "rb");
data/luksipc-0.04/random.c:81: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(aString, "%02x", rnd[i]);
data/luksipc-0.04/tests/prng/prng_crc64.c:33:22:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
	int64_t byteCount = atol(argv[1]);
data/luksipc-0.04/tests/prng/prng_crc64.c:44:15:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
		intState ^= atol(argv[2]);
data/luksipc-0.04/utils.c:47: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(aDest, aSrc, aDestArraySize - 1);
data/luksipc-0.04/utils.c:67: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).
	int fd = open(aPath, O_RDONLY);
data/luksipc-0.04/chunk.c:69:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	bytesRead = read(aFd, aChunk->data, aSize);
data/luksipc-0.04/luks.c:168: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 (aAliasPrefix && (strlen(aAliasPrefix) < 32)) {
data/luksipc-0.04/luks.c:177: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).
	char *aliasPathname = malloc(strlen("/dev/mapper/") + strlen(alias) + 1);
data/luksipc-0.04/luks.c:177:56:  [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 *aliasPathname = malloc(strlen("/dev/mapper/") + strlen(alias) + 1);
data/luksipc-0.04/luksipc.c:95:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ssize_t result = read(aFd, aData, aLength);
data/luksipc-0.04/luksipc.c:273:4:  [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(500 * 1000);
data/luksipc-0.04/parameters.c:148: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 ((aParams->luksFormatParams) && ((strlen(aParams->luksFormatParams) + 1) > MAX_ARGLENGTH)) {
data/luksipc-0.04/random.c:77:22:  [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).
	aString = aString + strlen(aString);
data/luksipc-0.04/utils.c:44: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).
	size_t srcLen = strlen(aSrc);

ANALYSIS SUMMARY:

Hits = 43
Lines analyzed = 2894 in approximately 0.14 seconds (21115 lines/second)
Physical Source Lines of Code (SLOC) = 1852
Hits@level = [0] 129 [1]   9 [2]  28 [3]   1 [4]   5 [5]   0
Hits@level+ = [0+] 172 [1+]  43 [2+]  34 [3+]   6 [4+]   5 [5+]   0
Hits/KSLOC@level+ = [0+] 92.8726 [1+] 23.2181 [2+] 18.3585 [3+] 3.23974 [4+] 2.69978 [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.