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/unshield-1.4.2/lib/bswap.c
Examining data/unshield-1.4.2/lib/cabfile.h
Examining data/unshield-1.4.2/lib/component.c
Examining data/unshield-1.4.2/lib/convert_utf/ConvertUTF.c
Examining data/unshield-1.4.2/lib/convert_utf/ConvertUTF.h
Examining data/unshield-1.4.2/lib/directory.c
Examining data/unshield-1.4.2/lib/file.c
Examining data/unshield-1.4.2/lib/file_group.c
Examining data/unshield-1.4.2/lib/helper.c
Examining data/unshield-1.4.2/lib/internal.h
Examining data/unshield-1.4.2/lib/libunshield.c
Examining data/unshield-1.4.2/lib/libunshield.h
Examining data/unshield-1.4.2/lib/log.c
Examining data/unshield-1.4.2/lib/log.h
Examining data/unshield-1.4.2/lib/md5/global.h
Examining data/unshield-1.4.2/lib/md5/md5.h
Examining data/unshield-1.4.2/lib/md5/md5c.c
Examining data/unshield-1.4.2/src/unshield-deobfuscate.c
Examining data/unshield-1.4.2/src/unshield.c

FINAL RESULTS:

data/unshield-1.4.2/lib/helper.c:54:8:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    if(snprintf(filename, path_max, unshield->filename_pattern, index, suffix)>=path_max)
data/unshield-1.4.2/lib/log.c:24: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, ap);
data/unshield-1.4.2/src/unshield.c:416: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(dirname, prefix);
data/unshield-1.4.2/src/unshield.c:434:9:  [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(dirname, tmp);
data/unshield-1.4.2/src/unshield.c:679:9:  [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(dirname, prefix);
data/unshield-1.4.2/src/unshield.c:685: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(dirname,
data/unshield-1.4.2/lib/helper.c:14:11:  [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.
  #define realpath(N,R) _fullpath((R),(N),_MAX_PATH)
data/unshield-1.4.2/src/unshield.c:34:11:  [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.
  #define realpath(N,R) _fullpath((R),(N),_MAX_PATH)
data/unshield-1.4.2/src/unshield.c:235: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, "c:d:D:g:hi:e:jLnoOrRV")) != -1)
data/unshield-1.4.2/src/unshield.c:514:3:  [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(output_directory, real_output_directory);
data/unshield-1.4.2/src/unshield.c:515:3:  [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(filename, real_filename);
data/unshield-1.4.2/lib/convert_utf/ConvertUTF.c:174:14:  [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 trailingBytesForUTF8[256] = {
data/unshield-1.4.2/lib/file.c:73:9:  [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(fd->md5, p, 0x10); p += 0x10;
data/unshield-1.4.2/lib/file.c:104: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(fd->md5, p, 0x10); p += 0x10;
data/unshield-1.4.2/lib/file.c:692: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).
    output = fopen(filename, "wb");
data/unshield-1.4.2/lib/file.c:804:14:  [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 md5result[16];
data/unshield-1.4.2/lib/file.c:894: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).
    output = fopen(filename, "wb");
data/unshield-1.4.2/lib/file.c:1011: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).
    output = fopen(filename, "wb");
data/unshield-1.4.2/lib/helper.c:110: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).
    result = fopen(filename, "rb");
data/unshield-1.4.2/lib/libunshield.c:23: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 pattern[256];
data/unshield-1.4.2/lib/md5/md5.h:30: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 buffer[64];                         /* input buffer */
data/unshield-1.4.2/lib/md5/md5c.c:56: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 unsigned char PADDING[64] = {
data/unshield-1.4.2/lib/md5/md5c.c:158:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
unsigned char digest[16];                         /* message digest */
data/unshield-1.4.2/lib/md5/md5c.c:161: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 bits[8];
data/unshield-1.4.2/lib/md5/md5c.c:187:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
unsigned char block[64];
data/unshield-1.4.2/lib/md5/md5c.c:332: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 *)output)[i] = (char)value;
data/unshield-1.4.2/src/unshield-deobfuscate.c:12: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 buffer[16384];
data/unshield-1.4.2/src/unshield-deobfuscate.c:23:11:  [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).
  input = fopen(argv[1], "rb");
data/unshield-1.4.2/src/unshield-deobfuscate.c:32: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).
  output = fopen(argv[2], "wb");
data/unshield-1.4.2/src/unshield.c:168: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, newbuf, newsize);
data/unshield-1.4.2/src/unshield.c:248:21:  [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_level = atoi(optarg);
data/unshield-1.4.2/src/unshield.c:256:22:  [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).
        is_version = atoi(optarg);
data/unshield-1.4.2/src/unshield.c:671: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 dirname[4096];
data/unshield-1.4.2/lib/helper.c:67:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy( dirname, unshield->filename_pattern,path_max);
data/unshield-1.4.2/lib/helper.c:77:7:  [1] (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 character.
      strcpy(dirname,".");
data/unshield-1.4.2/src/unshield.c:125: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).
          if(strlen(directory)>NAME_MAX)
data/unshield-1.4.2/src/unshield.c:154: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).
  inbytesleft = strlen(buffer);
data/unshield-1.4.2/src/unshield.c:397:6:  [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(output_directory) < path_max-1)
data/unshield-1.4.2/src/unshield.c:399:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(dirname, output_directory,path_max-1);
data/unshield-1.4.2/src/unshield.c:402:5:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
    strcat(dirname, "/");
data/unshield-1.4.2/src/unshield.c:414: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(dirname)+strlen(prefix) < path_max-1)
data/unshield-1.4.2/src/unshield.c:414: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(dirname)+strlen(prefix) < path_max-1)
data/unshield-1.4.2/src/unshield.c:417:7:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
      strcat(dirname, "/");
data/unshield-1.4.2/src/unshield.c:432: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(dirname)+strlen(tmp) < path_max-1)
data/unshield-1.4.2/src/unshield.c:432: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(strlen(dirname)+strlen(tmp) < path_max-1)
data/unshield-1.4.2/src/unshield.c:435:9:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
        strcat(dirname, "/");
data/unshield-1.4.2/src/unshield.c:446: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).
  for (p = dirname + strlen(output_directory); *p != '\0'; p++)
data/unshield-1.4.2/src/unshield.c:484: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).
  if (dirname[strlen(dirname)-1] != '/')
data/unshield-1.4.2/src/unshield.c:485:5:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
    strcat(dirname, "/");
data/unshield-1.4.2/src/unshield.c:493: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).
  for (p = filename + strlen(dirname); *p != '\0'; p++)
data/unshield-1.4.2/src/unshield.c:505: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 (!convert_encoding(filename + strlen(dirname),
data/unshield-1.4.2/src/unshield.c:506: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).
      sizeof(filename) - strlen(dirname)))
data/unshield-1.4.2/src/unshield.c:518:40:  [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).
                                       strlen(real_output_directory)) != 0)
data/unshield-1.4.2/src/unshield.c:680:9:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
        strcat(dirname, "\\");
data/unshield-1.4.2/src/unshield.c:689: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 (p = dirname + strlen(output_directory); *p != '\0'; p++)
data/unshield-1.4.2/src/unshield.c:694: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 (dirname[strlen(dirname)-1] != '\\')
data/unshield-1.4.2/src/unshield.c:695:9:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
        strcat(dirname, "\\");

ANALYSIS SUMMARY:

Hits = 57
Lines analyzed = 4463 in approximately 0.12 seconds (38680 lines/second)
Physical Source Lines of Code (SLOC) = 3297
Hits@level = [0]  48 [1]  24 [2]  22 [3]   5 [4]   6 [5]   0
Hits@level+ = [0+] 105 [1+]  57 [2+]  33 [3+]  11 [4+]   6 [5+]   0
Hits/KSLOC@level+ = [0+] 31.8471 [1+] 17.2884 [2+] 10.0091 [3+] 3.33637 [4+] 1.81984 [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.