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/dos2unix-7.4.1/common.c
Examining data/dos2unix-7.4.1/common.h
Examining data/dos2unix-7.4.1/dos2unix.c
Examining data/dos2unix-7.4.1/dos2unix.h
Examining data/dos2unix-7.4.1/querycp.c
Examining data/dos2unix-7.4.1/querycp.h
Examining data/dos2unix-7.4.1/test/setlocale.c
Examining data/dos2unix-7.4.1/test/testu16.c
Examining data/dos2unix-7.4.1/test/wcstombs_test.c
Examining data/dos2unix-7.4.1/unix2dos.c
Examining data/dos2unix-7.4.1/unix2dos.h

FINAL RESULTS:

data/dos2unix-7.4.1/common.c:1566:17:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
       RetVal = chmod (TempPath, StatBuf.st_mode); /* set original permissions */
data/dos2unix-7.4.1/common.c:1570:17:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
       RetVal = chmod(TempPath, StatBuf.st_mode & ~mask); /* set original permissions, minus umask */
data/dos2unix-7.4.1/common.c:1590:10:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
     if (chown(TempPath, StatBuf.st_uid, StatBuf.st_gid)) {
data/dos2unix-7.4.1/common.c:1600:20:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
          RetVal = chmod(TempPath, StatBuf.st_mode & ~mask); /* set original permissions, minus umask */
data/dos2unix-7.4.1/test/setlocale.c:74:3:  [5] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120). Risk is high,
  it appears that the size is given as bytes, but the function requires size
  as characters.
  MultiByteToWideChar(936, 0, str, -1, wstr, sizeof(wstr));
data/dos2unix-7.4.1/common.c:208:4:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
   vsnprintf(buf, sizeof(buf), formatmbs, args);
data/dos2unix-7.4.1/common.c:286:4:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
   vsnprintf(buf, sizeof(buf), format, args);
data/dos2unix-7.4.1/common.c:954:10:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
  return mktemp(template);
data/dos2unix-7.4.1/common.c:982:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
  sprintf(fname_str, "%s%s", dir, "/d2utmpXXXXXX");
data/dos2unix-7.4.1/common.h:316:26:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define D2U_UTF8_FPRINTF fprintf
data/dos2unix-7.4.1/common.h:317:26:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define D2U_ANSI_FPRINTF fprintf
data/dos2unix-7.4.1/common.c:1077:20:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
      char *rVal = realpath(lFN, targetFN);
data/dos2unix-7.4.1/common.c:2313:10:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
   ptr = getenv("DOS2UNIX_DISPLAY_ENC");
data/dos2unix-7.4.1/dos2unix.c:522:10:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
   ptr = getenv("DOS2UNIX_LOCALEDIR");
data/dos2unix-7.4.1/unix2dos.c:495:10:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
   ptr = getenv("DOS2UNIX_LOCALEDIR");
data/dos2unix-7.4.1/common.c:148:13:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
  if ( (i = MultiByteToWideChar(CodePage, dwFlags, lpMultiByteStr, cbMultiByte, lpWideCharStr, cchWideChar)) == 0)
data/dos2unix-7.4.1/common.c:188:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[D2U_MAX_PATH];
data/dos2unix-7.4.1/common.c:189: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 formatmbs[D2U_MAX_PATH];
data/dos2unix-7.4.1/common.c:190:4:  [2] (buffer) wchar_t:
  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.
   wchar_t formatwcs[D2U_MAX_PATH];
data/dos2unix-7.4.1/common.c:192:4:  [2] (buffer) wchar_t:
  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.
   wchar_t wstr[D2U_MAX_PATH];
data/dos2unix-7.4.1/common.c:280:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char buf[D2U_MAX_PATH];        /* ANSI encoded string */
data/dos2unix-7.4.1/common.c:281:4:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   char bufmbs[D2U_MAX_PATH];     /* UTF-8 encoded string */
data/dos2unix-7.4.1/common.c:282:4:  [2] (buffer) wchar_t:
  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.
   wchar_t bufwcs[D2U_MAX_PATH];  /* Wide encoded string */
data/dos2unix-7.4.1/common.c:307:4:  [2] (buffer) wchar_t:
  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.
   wchar_t oldnamew[D2U_MAX_PATH];
data/dos2unix-7.4.1/common.c:308:4:  [2] (buffer) wchar_t:
  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.
   wchar_t newnamew[D2U_MAX_PATH];
data/dos2unix-7.4.1/common.c:324:4:  [2] (buffer) wchar_t:
  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.
   wchar_t filenamew[D2U_MAX_PATH];
data/dos2unix-7.4.1/common.c:347:4:  [2] (buffer) wchar_t:
  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.
   wchar_t pathw[D2U_MAX_PATH];
data/dos2unix-7.4.1/common.c:401:4:  [2] (buffer) wchar_t:
  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.
   wchar_t pathw[D2U_MAX_PATH];
data/dos2unix-7.4.1/common.c:470:4:  [2] (buffer) wchar_t:
  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.
   wchar_t pathw[D2U_MAX_PATH];
data/dos2unix-7.4.1/common.c:792:3:  [2] (buffer) wchar_t:
  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.
  wchar_t pathw[D2U_MAX_PATH];
data/dos2unix-7.4.1/common.c:797: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).
  return (fopen(ipFN, R_CNTRL));
data/dos2unix-7.4.1/common.c:809:3:  [2] (buffer) wchar_t:
  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.
  wchar_t pathw[D2U_MAX_PATH];
data/dos2unix-7.4.1/common.c:814: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).
  return (fopen(opFN, W_CNTRL));
data/dos2unix-7.4.1/common.c:891:3:  [2] (buffer) wchar_t:
  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.
  wchar_t dnw[MAX_PATH];
data/dos2unix-7.4.1/common.c:892:3:  [2] (buffer) wchar_t:
  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.
  wchar_t bnw[MAX_PATH];
data/dos2unix-7.4.1/common.c:893:3:  [2] (buffer) wchar_t:
  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.
  wchar_t szTempFileNamew[MAX_PATH];
data/dos2unix-7.4.1/common.c:897: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 szTempFileName[MAX_PATH];
data/dos2unix-7.4.1/common.c:995:13:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
  if ((fd = mkstemp(fname_str)) == -1)
data/dos2unix-7.4.1/common.c:1246: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 informat[64];
data/dos2unix-7.4.1/common.c:1267:5:  [2] (buffer) wchar_t:
  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.
    wchar_t informatw[64];
data/dos2unix-7.4.1/common.c:1437:4:  [2] (buffer) wchar_t:
  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.
   wchar_t pathw[D2U_MAX_PATH];
data/dos2unix-7.4.1/common.c:1815: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 informat[32];
data/dos2unix-7.4.1/common.c:1816: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 outformat[64];
data/dos2unix-7.4.1/common.c:1818:3:  [2] (buffer) wchar_t:
  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.
  wchar_t informatw[32];
data/dos2unix-7.4.1/common.c:1819:3:  [2] (buffer) wchar_t:
  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.
  wchar_t outformatw[64];
data/dos2unix-7.4.1/common.c:2663:11:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
   static char mbs[8];
data/dos2unix-7.4.1/common.c:2665:11:  [2] (buffer) wchar_t:
  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 wchar_t wstr[3];
data/dos2unix-7.4.1/dos2unix.c:503: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 progname[9];
data/dos2unix-7.4.1/dos2unix.c:506: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 localedir[1024];
data/dos2unix-7.4.1/dos2unix.c:519: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(progname,"dos2unix");
data/dos2unix-7.4.1/dos2unix.c:572: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(progname,"mac2unix");
data/dos2unix-7.4.1/test/setlocale.c:63: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 str[5];      /* ANSI CP936 */
data/dos2unix-7.4.1/test/setlocale.c:64: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 ustr[15];    /* UTF-8 */
data/dos2unix-7.4.1/test/setlocale.c:65:3:  [2] (buffer) wchar_t:
  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.
  wchar_t wstr[10]; /* UTF-16 */
data/dos2unix-7.4.1/test/wcstombs_test.c:10:3:  [2] (buffer) wchar_t:
  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.
  wchar_t wstr[2];
data/dos2unix-7.4.1/test/wcstombs_test.c:11: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 str[5];
data/dos2unix-7.4.1/unix2dos.c:476: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 progname[9];
data/dos2unix-7.4.1/unix2dos.c:479: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 localedir[1024];
data/dos2unix-7.4.1/unix2dos.c:492: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(progname,"unix2dos");
data/dos2unix-7.4.1/unix2dos.c:545: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(progname,"unix2mac");
data/dos2unix-7.4.1/common.c:64:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(dest,src,dest_size);
data/dos2unix-7.4.1/common.c:67: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(src) > (dest_size-1)) {
data/dos2unix-7.4.1/common.c:68:137:  [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).
        D2U_UTF8_FPRINTF(stderr, "Text %s has been truncated from %d to %d characters in %s to prevent a buffer overflow.\n", src, (int)strlen(src), (int)dest_size, "d2u_strncpy()");
data/dos2unix-7.4.1/common.c:553:13:  [1] (buffer) wcslen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      len = wcslen(path) + wcslen(FindFileData.cFileName) + 2;
data/dos2unix-7.4.1/common.c:553:28:  [1] (buffer) wcslen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      len = wcslen(path) + wcslen(FindFileData.cFileName) + 2;
data/dos2unix-7.4.1/common.c:557:9:  [1] (buffer) wcsncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        wcsncpy(path_and_filename, path, wcslen(path)+1);
data/dos2unix-7.4.1/common.c:557:42:  [1] (buffer) wcslen:
  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).
        wcsncpy(path_and_filename, path, wcslen(path)+1);
data/dos2unix-7.4.1/common.c:558:9:  [1] (buffer) wcsncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, or
  automatically resizing strings.
        wcsncat(path_and_filename, FindFileData.cFileName, wcslen(FindFileData.cFileName)+1);
data/dos2unix-7.4.1/common.c:558:60:  [1] (buffer) wcslen:
  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).
        wcsncat(path_and_filename, FindFileData.cFileName, wcslen(FindFileData.cFileName)+1);
data/dos2unix-7.4.1/common.c:560:9:  [1] (buffer) wcsncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        wcsncpy(path_and_filename, FindFileData.cFileName, wcslen(FindFileData.cFileName)+1);
data/dos2unix-7.4.1/common.c:560:60:  [1] (buffer) wcslen:
  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).
        wcsncpy(path_and_filename, FindFileData.cFileName, wcslen(FindFileData.cFileName)+1);
data/dos2unix-7.4.1/common.c:942: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).
  len = strlen(szTempFileName) +1;
data/dos2unix-7.4.1/common.c:979: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).
  fname_len = strlen(dir) + strlen("/d2utmpXXXXXX") + sizeof (char);
data/dos2unix-7.4.1/common.c:979:29:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  fname_len = strlen(dir) + strlen("/d2utmpXXXXXX") + sizeof (char);
data/dos2unix-7.4.1/common.c:1120:21:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if ((bom[0] = fgetc(f)) == EOF) {
data/dos2unix-7.4.1/common.c:1132:21:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if ((bom[1] = fgetc(f)) == EOF) {
data/dos2unix-7.4.1/common.c:1149:21:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if ((bom[2] = fgetc(f)) == EOF) {
data/dos2unix-7.4.1/common.c:1164:19:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         bom[3] = fgetc(f);
data/dos2unix-7.4.1/common.c:1568:15:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
       mask = umask(0); /* get process's umask */
data/dos2unix-7.4.1/common.c:1569:8:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
       umask(mask); /* set umask back to original */
data/dos2unix-7.4.1/common.c:1598:18:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
          mask = umask(0); /* get process's umask */
data/dos2unix-7.4.1/common.c:1599:11:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
          umask(mask); /* set umask back to original */
data/dos2unix-7.4.1/common.c:2083:22:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  while ((TempChar = fgetc(ipInF)) != EOF) {
data/dos2unix-7.4.1/common.c:2627:17:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   if (((c_lead=fgetc(f)) == EOF)  || ((c_trail=fgetc(f)) == EOF))
data/dos2unix-7.4.1/common.c:2627:49:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
   if (((c_lead=fgetc(f)) == EOF)  || ((c_trail=fgetc(f)) == EOF))
data/dos2unix-7.4.1/dos2unix.c:141:24:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if ( (TempNextChar = fgetc(ipInF)) != EOF) {
data/dos2unix-7.4.1/dos2unix.c:383:28:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while ((TempChar = fgetc(ipInF)) != EOF) {  /* get character */
data/dos2unix-7.4.1/dos2unix.c:420:28:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while ((TempChar = fgetc(ipInF)) != EOF) {
data/dos2unix-7.4.1/dos2unix.c:447:34:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if ( (TempNextChar = fgetc(ipInF)) != EOF) {
data/dos2unix-7.4.1/dos2unix.c:526:11:  [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(ptr) < sizeof(localedir))
data/dos2unix-7.4.1/unix2dos.c:337:28:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while ((TempChar = fgetc(ipInF)) != EOF) {  /* get character */
data/dos2unix-7.4.1/unix2dos.c:363:32:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
               if ((TempChar = fgetc(ipInF)) == EOF) { /* get next char (possibly LF) */
data/dos2unix-7.4.1/unix2dos.c:397:28:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        while ((TempChar = fgetc(ipInF)) != EOF) {
data/dos2unix-7.4.1/unix2dos.c:499:11:  [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(ptr) < sizeof(localedir))

ANALYSIS SUMMARY:

Hits = 94
Lines analyzed = 5108 in approximately 0.21 seconds (24088 lines/second)
Physical Source Lines of Code (SLOC) = 3863
Hits@level = [0]  29 [1]  34 [2]  45 [3]   4 [4]   6 [5]   5
Hits@level+ = [0+] 123 [1+]  94 [2+]  60 [3+]  15 [4+]  11 [5+]   5
Hits/KSLOC@level+ = [0+] 31.8405 [1+] 24.3334 [2+] 15.532 [3+] 3.88299 [4+] 2.84753 [5+] 1.29433
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.