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/dmg2img-1.6.7/adc.c
Examining data/dmg2img-1.6.7/adc.h
Examining data/dmg2img-1.6.7/base64.c
Examining data/dmg2img-1.6.7/base64.h
Examining data/dmg2img-1.6.7/dmg2img.c
Examining data/dmg2img-1.6.7/dmg2img.h
Examining data/dmg2img-1.6.7/gpt.h
Examining data/dmg2img-1.6.7/mntcmd.h
Examining data/dmg2img-1.6.7/vfdecrypt.h
Examining data/dmg2img-1.6.7/vfdecrypt.c

FINAL RESULTS:

data/dmg2img-1.6.7/dmg2img.c:147: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(output_file, input_file);
data/dmg2img-1.6.7/dmg2img.c:426:6:  [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(sztype, reserved);
data/dmg2img-1.6.7/vfdecrypt.c:397:7:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
      sprintf(cmd, 
data/dmg2img-1.6.7/vfdecrypt.c:400:7:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      system(cmd);
data/dmg2img-1.6.7/vfdecrypt.c:349:14:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while((c = getopt(argc, argv, "hvei:o:p:k:")) != -1) {
data/dmg2img-1.6.7/adc.c:28: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(outp, inp + 1, chunk_size);
data/dmg2img-1.6.7/adc.c:46: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(outp, outp - offset - 1, 1);
data/dmg2img-1.6.7/adc.c:66: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(outp, outp - offset - 1, 1);
data/dmg2img-1.6.7/dmg2img.c:74: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 sp[128];
data/dmg2img-1.6.7/dmg2img.c:82: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(sp, "[%d] %6.2f%%", s, percent);
data/dmg2img-1.6.7/dmg2img.c:87: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(sp, "%6.2f%%", percent);
data/dmg2img-1.6.7/dmg2img.c:107: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 partname[255] = "";
data/dmg2img-1.6.7/dmg2img.c:112: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 reserved[5] = "    ";
data/dmg2img-1.6.7/dmg2img.c:113: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 sztype[64] = "";
data/dmg2img-1.6.7/dmg2img.c:149:5:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
				strcat(output_file, ".img");
data/dmg2img-1.6.7/dmg2img.c:151:5:  [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(&output_file[i - 4], ".img");
data/dmg2img-1.6.7/dmg2img.c:157:10:  [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).
		FDBG = fopen("dmg2img.log", "wb");
data/dmg2img-1.6.7/dmg2img.c:163:8:  [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).
	FIN = fopen(input_file, "rb");
data/dmg2img-1.6.7/dmg2img.c:176: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 szSignature[5];
data/dmg2img-1.6.7/dmg2img.c:179: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(szSignature, &rSignature, 4);
data/dmg2img-1.6.7/dmg2img.c:235: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(blkx, _blkx_begin, blkx_size);
data/dmg2img-1.6.7/dmg2img.c:265: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(base64data, data_begin, data_size);
data/dmg2img-1.6.7/dmg2img.c:277:21:  [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.
			parts[i].Data = (char *)malloc(parts[i].BlocksRunCount * 0x28);
data/dmg2img-1.6.7/dmg2img.c:280: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(parts[i].Data, base64data + 0xCC, parts[i].BlocksRunCount * 0x28);
data/dmg2img-1.6.7/dmg2img.c:289: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(partname, partname_begin, partname_end - partname_begin);
data/dmg2img-1.6.7/dmg2img.c:323: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(&parts[i], &mishblk, sizeof(struct _mishblk));
data/dmg2img-1.6.7/dmg2img.c:327: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(parts[i].Data, mish_begin + 0xCC, 0x28 * mishblk.BlocksRunCount);
data/dmg2img-1.6.7/dmg2img.c:353:10:  [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).
		FOUT = fopen(output_file, "wb");
data/dmg2img-1.6.7/dmg2img.c:395: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.
			block_type = convert_char4((unsigned char *)parts[i].Data + offset);
data/dmg2img-1.6.7/dmg2img.c:396:42:  [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.
			dw_reserved = convert_char4((unsigned char *)parts[i].Data + offset + 4);
data/dmg2img-1.6.7/dmg2img.c:397: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(&reserved, parts[i].Data + offset + 4, 4);
data/dmg2img-1.6.7/dmg2img.c:398:39:  [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.
			out_offs = convert_char8((unsigned char *)parts[i].Data + offset + 8) * 0x200;
data/dmg2img-1.6.7/dmg2img.c:399:39:  [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.
			out_size = convert_char8((unsigned char *)parts[i].Data + offset + 16) * 0x200;
data/dmg2img-1.6.7/dmg2img.c:400:38:  [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.
			in_offs = convert_char8((unsigned char *)parts[i].Data + offset + 24);
data/dmg2img-1.6.7/dmg2img.c:401:38:  [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.
			in_size = convert_char8((unsigned char *)parts[i].Data + offset + 32);
data/dmg2img-1.6.7/dmg2img.c:407:6:  [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(sztype, "adc");
data/dmg2img-1.6.7/dmg2img.c:410:6:  [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(sztype, "zlib");
data/dmg2img-1.6.7/dmg2img.c:413:6:  [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(sztype, "bzlib");
data/dmg2img-1.6.7/dmg2img.c:416:6:  [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(sztype, "zero");
data/dmg2img-1.6.7/dmg2img.c:419:6:  [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(sztype, "ignore");
data/dmg2img-1.6.7/dmg2img.c:422:6:  [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(sztype, "raw");
data/dmg2img-1.6.7/dmg2img.c:425:6:  [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(sztype, "comment ");
data/dmg2img-1.6.7/dmg2img.c:429:6:  [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(sztype, "terminator");
data/dmg2img-1.6.7/dmg2img.c:607:34:  [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.
					if (convert_char8((unsigned char *)parts[i+1].Data + 24) != 0)
data/dmg2img-1.6.7/dmg2img.h:110: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 Reserved3[120];
data/dmg2img-1.6.7/dmg2img.h:113: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 Reserved4[120];
data/dmg2img-1.6.7/dmg2img.h:118: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 Reserved7[120];
data/dmg2img-1.6.7/dmg2img.h:121: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 Reserved8[12];
data/dmg2img-1.6.7/dmg2img.h:134: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 Reserved1[24];
data/dmg2img-1.6.7/dmg2img.h:139: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 Reserved4[120];
data/dmg2img-1.6.7/dmg2img.h:172: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(m, c, 0xCC);
data/dmg2img-1.6.7/gpt.h:36: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 hdr_sig[8];
data/dmg2img-1.6.7/mntcmd.h:26: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 tmp[128];
data/dmg2img-1.6.7/mntcmd.h:31: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(filename, "rb");
data/dmg2img-1.6.7/mntcmd.h:48: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(&gpt_ent_array[i], &gpt_entry, sizeof(struct _gpt_entry));
data/dmg2img-1.6.7/mntcmd.h:56:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
				sprintf(tmp, " (for partition %d)", i + 1);
data/dmg2img-1.6.7/vfdecrypt.c:71: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 sig[8];
data/dmg2img-1.6.7/vfdecrypt.c:79: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 uuid[16];
data/dmg2img-1.6.7/vfdecrypt.c:195: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 mdResult[MD_LENGTH];
data/dmg2img-1.6.7/vfdecrypt.c:202: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(iv, mdResult, CIPHER_BLOCKSIZE);
data/dmg2img-1.6.7/vfdecrypt.c:257: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(unwrapped_key, CEKICV+4, outlen-4);
data/dmg2img-1.6.7/vfdecrypt.c:307: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(aes_key, TEMP1, 16);
data/dmg2img-1.6.7/vfdecrypt.c:308: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(hmacsha1_key, TEMP1, 20);
data/dmg2img-1.6.7/vfdecrypt.c:332: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 inFile[512], outFile[512], passphrase[512], cmd[640];
data/dmg2img-1.6.7/vfdecrypt.c:390:15:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((in = fopen(inFile, "rb")) == NULL) {
data/dmg2img-1.6.7/vfdecrypt.c:407: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).
    if ((out = fopen(outFile, "wb")) == NULL) {
data/dmg2img-1.6.7/vfdecrypt.h:33: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 sig[8];
data/dmg2img-1.6.7/vfdecrypt.h:41: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 uuid[16];
data/dmg2img-1.6.7/dmg2img.c:83: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).
		for (i = 0; i < strlen(sp); i++)
data/dmg2img-1.6.7/dmg2img.c:88: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).
		for (i = 0; i < strlen(sp); i++)
data/dmg2img-1.6.7/dmg2img.c:144: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).
		i = strlen(input_file);
data/dmg2img-1.6.7/dmg2img.c: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).
		scb = strlen(chunk_begin);
data/dmg2img-1.6.7/dmg2img.c:269: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).
			decode_base64(base64data, strlen(base64data), base64data, &tmplen);
data/dmg2img-1.6.7/dmg2img.c:286:58:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			partname_begin = strstr(partname_begin, name_begin) + strlen(name_begin);
data/dmg2img-1.6.7/vfdecrypt.c:268: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).
  PKCS5_PBKDF2_HMAC_SHA1(passphrase, strlen(passphrase), (unsigned char*)header->kdf_salt, 20, 
data/dmg2img-1.6.7/vfdecrypt.c:286: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).
  PKCS5_PBKDF2_HMAC_SHA1(passphrase, strlen(passphrase), (unsigned char*)header->kdf_salt, 20,
data/dmg2img-1.6.7/vfdecrypt.c:361:18:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      if(optarg) strncpy(inFile, optarg, sizeof(inFile)-1);
data/dmg2img-1.6.7/vfdecrypt.c:365:19:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      if (optarg) strncpy(outFile, optarg, sizeof(outFile)-1);
data/dmg2img-1.6.7/vfdecrypt.c:369:19:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      if (optarg) strncpy(passphrase, optarg, sizeof(passphrase)-1);
data/dmg2img-1.6.7/vfdecrypt.c:387: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(inFile) == 0) {
data/dmg2img-1.6.7/vfdecrypt.c:404: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(outFile) == 0) {

ANALYSIS SUMMARY:

Hits = 81
Lines analyzed = 1847 in approximately 0.16 seconds (11686 lines/second)
Physical Source Lines of Code (SLOC) = 1472
Hits@level = [0] 130 [1]  13 [2]  63 [3]   1 [4]   4 [5]   0
Hits@level+ = [0+] 211 [1+]  81 [2+]  68 [3+]   5 [4+]   4 [5+]   0
Hits/KSLOC@level+ = [0+] 143.342 [1+] 55.0272 [2+] 46.1957 [3+] 3.39674 [4+] 2.71739 [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.