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/xpdf-3.04/goo/gmem.h
Examining data/xpdf-3.04/goo/gmem.cc
Examining data/xpdf-3.04/goo/parseargs.c
Examining data/xpdf-3.04/goo/GMutex.h
Examining data/xpdf-3.04/goo/FixedPoint.cc
Examining data/xpdf-3.04/goo/GList.cc
Examining data/xpdf-3.04/goo/gmempp.cc
Examining data/xpdf-3.04/goo/FixedPoint.h
Examining data/xpdf-3.04/goo/gfile.cc
Examining data/xpdf-3.04/goo/gfile.h
Examining data/xpdf-3.04/goo/GHash.cc
Examining data/xpdf-3.04/goo/GHash.h
Examining data/xpdf-3.04/goo/GList.h
Examining data/xpdf-3.04/goo/GString.cc
Examining data/xpdf-3.04/goo/GString.h
Examining data/xpdf-3.04/goo/gtypes.h
Examining data/xpdf-3.04/goo/parseargs.h
Examining data/xpdf-3.04/xpdf/TextString.h
Examining data/xpdf-3.04/xpdf/Dict.h
Examining data/xpdf-3.04/xpdf/PDFDocEncoding.h
Examining data/xpdf-3.04/xpdf/UnicodeMapTables.h
Examining data/xpdf-3.04/xpdf/BuiltinFontTables.h
Examining data/xpdf-3.04/xpdf/Error.h
Examining data/xpdf-3.04/xpdf/Page.h
Examining data/xpdf-3.04/xpdf/Link.h
Examining data/xpdf-3.04/xpdf/CharTypes.h
Examining data/xpdf-3.04/xpdf/about-text.h
Examining data/xpdf-3.04/xpdf/XFAForm.h
Examining data/xpdf-3.04/xpdf/UnicodeTypeTable.cc
Examining data/xpdf-3.04/xpdf/CompactFontTables.h
Examining data/xpdf-3.04/xpdf/Form.cc
Examining data/xpdf-3.04/xpdf/BuiltinFontTables.cc
Examining data/xpdf-3.04/xpdf/ErrorCodes.h
Examining data/xpdf-3.04/xpdf/HTMLGen.h
Examining data/xpdf-3.04/xpdf/Dict.cc
Examining data/xpdf-3.04/xpdf/BuiltinFont.cc
Examining data/xpdf-3.04/xpdf/FontEncodingTables.cc
Examining data/xpdf-3.04/xpdf/OptionalContent.cc
Examining data/xpdf-3.04/xpdf/Lexer.h
Examining data/xpdf-3.04/xpdf/Stream-CCITT.h
Examining data/xpdf-3.04/xpdf/PreScanOutputDev.cc
Examining data/xpdf-3.04/xpdf/XpdfPluginAPI.h
Examining data/xpdf-3.04/xpdf/TextString.cc
Examining data/xpdf-3.04/xpdf/OutputDev.cc
Examining data/xpdf-3.04/xpdf/CharCodeToUnicode.h
Examining data/xpdf-3.04/xpdf/PDFDocEncoding.cc
Examining data/xpdf-3.04/xpdf/XPDFTree.h
Examining data/xpdf-3.04/xpdf/FontEncodingTables.h
Examining data/xpdf-3.04/xpdf/XPDFTreeP.h
Examining data/xpdf-3.04/xpdf/NameToUnicodeTable.h
Examining data/xpdf-3.04/xpdf/PSTokenizer.cc
Examining data/xpdf-3.04/xpdf/Outline.cc
Examining data/xpdf-3.04/xpdf/Outline.h
Examining data/xpdf-3.04/xpdf/XPDFTree.cc
Examining data/xpdf-3.04/xpdf/Array.cc
Examining data/xpdf-3.04/xpdf/Catalog.h
Examining data/xpdf-3.04/xpdf/NameToCharCode.cc
Examining data/xpdf-3.04/xpdf/Array.h
Examining data/xpdf-3.04/xpdf/CoreOutputDev.h
Examining data/xpdf-3.04/xpdf/Page.cc
Examining data/xpdf-3.04/xpdf/PSOutputDev.h
Examining data/xpdf-3.04/xpdf/UTF8.h
Examining data/xpdf-3.04/xpdf/NameToCharCode.h
Examining data/xpdf-3.04/xpdf/config.h
Examining data/xpdf-3.04/xpdf/CoreOutputDev.cc
Examining data/xpdf-3.04/xpdf/pdfimages.cc
Examining data/xpdf-3.04/xpdf/PDFDoc.h
Examining data/xpdf-3.04/xpdf/AcroForm.cc
Examining data/xpdf-3.04/xpdf/AcroForm.h
Examining data/xpdf-3.04/xpdf/Annot.cc
Examining data/xpdf-3.04/xpdf/Annot.h
Examining data/xpdf-3.04/xpdf/BuiltinFont.h
Examining data/xpdf-3.04/xpdf/Catalog.cc
Examining data/xpdf-3.04/xpdf/CharCodeToUnicode.cc
Examining data/xpdf-3.04/xpdf/CMap.cc
Examining data/xpdf-3.04/xpdf/CMap.h
Examining data/xpdf-3.04/xpdf/Decrypt.cc
Examining data/xpdf-3.04/xpdf/Decrypt.h
Examining data/xpdf-3.04/xpdf/Error.cc
Examining data/xpdf-3.04/xpdf/Form.h
Examining data/xpdf-3.04/xpdf/Function.cc
Examining data/xpdf-3.04/xpdf/Function.h
Examining data/xpdf-3.04/xpdf/Gfx.cc
Examining data/xpdf-3.04/xpdf/GfxFont.cc
Examining data/xpdf-3.04/xpdf/GfxFont.h
Examining data/xpdf-3.04/xpdf/Gfx.h
Examining data/xpdf-3.04/xpdf/GfxState.cc
Examining data/xpdf-3.04/xpdf/GfxState.h
Examining data/xpdf-3.04/xpdf/HTMLGen.cc
Examining data/xpdf-3.04/xpdf/ImageOutputDev.cc
Examining data/xpdf-3.04/xpdf/ImageOutputDev.h
Examining data/xpdf-3.04/xpdf/JArithmeticDecoder.cc
Examining data/xpdf-3.04/xpdf/JArithmeticDecoder.h
Examining data/xpdf-3.04/xpdf/JBIG2Stream.cc
Examining data/xpdf-3.04/xpdf/JBIG2Stream.h
Examining data/xpdf-3.04/xpdf/JPXStream.cc
Examining data/xpdf-3.04/xpdf/JPXStream.h
Examining data/xpdf-3.04/xpdf/Lexer.cc
Examining data/xpdf-3.04/xpdf/Link.cc
Examining data/xpdf-3.04/xpdf/Object.cc
Examining data/xpdf-3.04/xpdf/Object.h
Examining data/xpdf-3.04/xpdf/OptionalContent.h
Examining data/xpdf-3.04/xpdf/OutputDev.h
Examining data/xpdf-3.04/xpdf/Parser.cc
Examining data/xpdf-3.04/xpdf/Parser.h
Examining data/xpdf-3.04/xpdf/pdfdetach.cc
Examining data/xpdf-3.04/xpdf/PDFDoc.cc
Examining data/xpdf-3.04/xpdf/pdffonts.cc
Examining data/xpdf-3.04/xpdf/pdfinfo.cc
Examining data/xpdf-3.04/xpdf/pdftohtml.cc
Examining data/xpdf-3.04/xpdf/pdftopng.cc
Examining data/xpdf-3.04/xpdf/pdftoppm.cc
Examining data/xpdf-3.04/xpdf/pdftops.cc
Examining data/xpdf-3.04/xpdf/pdftotext.cc
Examining data/xpdf-3.04/xpdf/PreScanOutputDev.h
Examining data/xpdf-3.04/xpdf/PSOutputDev.cc
Examining data/xpdf-3.04/xpdf/PSTokenizer.h
Examining data/xpdf-3.04/xpdf/SecurityHandler.cc
Examining data/xpdf-3.04/xpdf/SecurityHandler.h
Examining data/xpdf-3.04/xpdf/SplashOutputDev.cc
Examining data/xpdf-3.04/xpdf/SplashOutputDev.h
Examining data/xpdf-3.04/xpdf/Stream.cc
Examining data/xpdf-3.04/xpdf/Stream.h
Examining data/xpdf-3.04/xpdf/TextOutputDev.cc
Examining data/xpdf-3.04/xpdf/TextOutputDev.h
Examining data/xpdf-3.04/xpdf/UnicodeMap.cc
Examining data/xpdf-3.04/xpdf/UnicodeMap.h
Examining data/xpdf-3.04/xpdf/UnicodeTypeTable.h
Examining data/xpdf-3.04/xpdf/XFAForm.cc
Examining data/xpdf-3.04/xpdf/xpdf.cc
Examining data/xpdf-3.04/xpdf/XPDFCore.h
Examining data/xpdf-3.04/xpdf/XpdfPluginAPI.cc
Examining data/xpdf-3.04/xpdf/XRef.cc
Examining data/xpdf-3.04/xpdf/XRef.h
Examining data/xpdf-3.04/xpdf/Zoox.cc
Examining data/xpdf-3.04/xpdf/Zoox.h
Examining data/xpdf-3.04/xpdf/PDFCore.cc
Examining data/xpdf-3.04/xpdf/PDFCore.h
Examining data/xpdf-3.04/xpdf/XPDFApp.cc
Examining data/xpdf-3.04/xpdf/XPDFApp.h
Examining data/xpdf-3.04/xpdf/XPDFCore.cc
Examining data/xpdf-3.04/xpdf/GlobalParams.cc
Examining data/xpdf-3.04/xpdf/GlobalParams.h
Examining data/xpdf-3.04/xpdf/XPDFViewer.cc
Examining data/xpdf-3.04/xpdf/XPDFViewer.h
Examining data/xpdf-3.04/aconf2.h
Examining data/xpdf-3.04/splash/SplashMath.h
Examining data/xpdf-3.04/splash/SplashPattern.h
Examining data/xpdf-3.04/splash/SplashErrorCodes.h
Examining data/xpdf-3.04/splash/SplashFTFontFile.h
Examining data/xpdf-3.04/splash/SplashXPath.h
Examining data/xpdf-3.04/splash/SplashXPath.cc
Examining data/xpdf-3.04/splash/SplashFTFont.h
Examining data/xpdf-3.04/splash/SplashFontFileID.cc
Examining data/xpdf-3.04/splash/SplashPattern.cc
Examining data/xpdf-3.04/splash/SplashBitmap.cc
Examining data/xpdf-3.04/splash/SplashBitmap.h
Examining data/xpdf-3.04/splash/Splash.cc
Examining data/xpdf-3.04/splash/SplashClip.cc
Examining data/xpdf-3.04/splash/SplashClip.h
Examining data/xpdf-3.04/splash/SplashFont.cc
Examining data/xpdf-3.04/splash/SplashFontEngine.cc
Examining data/xpdf-3.04/splash/SplashFontEngine.h
Examining data/xpdf-3.04/splash/SplashFontFile.cc
Examining data/xpdf-3.04/splash/SplashFontFile.h
Examining data/xpdf-3.04/splash/SplashFontFileID.h
Examining data/xpdf-3.04/splash/SplashFont.h
Examining data/xpdf-3.04/splash/SplashFTFont.cc
Examining data/xpdf-3.04/splash/SplashFTFontEngine.cc
Examining data/xpdf-3.04/splash/SplashFTFontEngine.h
Examining data/xpdf-3.04/splash/SplashFTFontFile.cc
Examining data/xpdf-3.04/splash/SplashGlyphBitmap.h
Examining data/xpdf-3.04/splash/Splash.h
Examining data/xpdf-3.04/splash/SplashPath.cc
Examining data/xpdf-3.04/splash/SplashPath.h
Examining data/xpdf-3.04/splash/SplashScreen.cc
Examining data/xpdf-3.04/splash/SplashScreen.h
Examining data/xpdf-3.04/splash/SplashState.cc
Examining data/xpdf-3.04/splash/SplashState.h
Examining data/xpdf-3.04/splash/SplashTypes.h
Examining data/xpdf-3.04/splash/SplashXPathScanner.cc
Examining data/xpdf-3.04/splash/SplashXPathScanner.h

FINAL RESULTS:

data/xpdf-3.04/goo/gmem.cc:263: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(s1, s);
data/xpdf-3.04/xpdf/CMap.cc:184:7:  [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(tok1, tok2);
data/xpdf-3.04/xpdf/CharCodeToUnicode.cc:373:7:  [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(tok1, tok2);
data/xpdf-3.04/xpdf/ImageOutputDev.cc:60:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(fileName, "%s-%04d.jpg", fileRoot, imgNum);
data/xpdf-3.04/xpdf/ImageOutputDev.cc:83:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(fileName, "%s-%04d.pbm", fileRoot, imgNum);
data/xpdf-3.04/xpdf/ImageOutputDev.cc:132:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(fileName, "%s-%04d.jpg", fileRoot, imgNum);
data/xpdf-3.04/xpdf/ImageOutputDev.cc:156:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(fileName, "%s-%04d.pbm", fileRoot, imgNum);
data/xpdf-3.04/xpdf/ImageOutputDev.cc:187:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(fileName, "%s-%04d.ppm", fileRoot, imgNum);
data/xpdf-3.04/xpdf/PSOutputDev.cc:1077:15:  [4] (shell) popen:
  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.
    if (!(f = popen(fileName + 1, "w"))) {
data/xpdf-3.04/xpdf/XPDFCore.cc:628:12:  [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.
	errcode = system(fileName->c_str());
data/xpdf-3.04/xpdf/XPDFCore.cc:636:14:  [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.
	  errcode = system(fileName->c_str());
data/xpdf-3.04/xpdf/XPDFCore.cc:776:13:  [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.
  errcode = system(cmd->c_str());
data/xpdf-3.04/xpdf/XPDFViewer.cc:1249:13:  [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.
  errcode = system(cmd->c_str());
data/xpdf-3.04/xpdf/config.h:84:9:  [4] (shell) popen:
  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.
#define popen _popen
data/xpdf-3.04/goo/GMutex.h:31:23:  [3] (misc) InitializeCriticalSection:
  Exceptions can be thrown in low-memory situations. Use
  InitializeCriticalSectionAndSpinCount instead.
#define gInitMutex(m) InitializeCriticalSection(m)
data/xpdf-3.04/goo/GMutex.h:33:23:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
#define gLockMutex(m) EnterCriticalSection(m)
data/xpdf-3.04/goo/gfile.cc:56:12:  [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.
  if ((s = getenv("HOME")))
data/xpdf-3.04/goo/gfile.cc:76:12:  [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.
  if ((s = getenv("HOME"))) {
data/xpdf-3.04/goo/gfile.cc:79:14:  [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.
    if ((s = getenv("USER")))
data/xpdf-3.04/splash/SplashScreen.cc:244:3:  [3] (random) srand:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  srand(123);
data/xpdf-3.04/goo/GList.cc: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(ret->data, data, length * sizeof(void *));
data/xpdf-3.04/goo/GString.cc:122: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(s1, s, length1);
data/xpdf-3.04/goo/GString.cc:125: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(s1, s, length + 1);
data/xpdf-3.04/goo/GString.cc:143: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(s, sA, n + 1);
data/xpdf-3.04/goo/GString.cc:149: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(s, sA, length * sizeof(char));
data/xpdf-3.04/goo/GString.cc:156: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(s, str->c_str() + idx, length);
data/xpdf-3.04/goo/GString.cc:163: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(s, str->c_str(), length + 1);
data/xpdf-3.04/goo/GString.cc:175: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(s, str1->c_str(), n1);
data/xpdf-3.04/goo/GString.cc:176: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(s + n1, str2->c_str(), n2 + 1);
data/xpdf-3.04/goo/GString.cc:180: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 buf[24]; // enough space for 64-bit ints plus a little extra
data/xpdf-3.04/goo/GString.cc:234: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(s + length, str->c_str(), n + 1);
data/xpdf-3.04/goo/GString.cc:246: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(s + length, str, n + 1);
data/xpdf-3.04/goo/GString.cc:256: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(s + length, str, lengthA);
data/xpdf-3.04/goo/GString.cc:278: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 buf[65];
data/xpdf-3.04/goo/GString.cc:583: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.
  static char vals[17] = "0123456789abcdef";
data/xpdf-3.04/goo/GString.cc:621: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.
  static char vals[17] = "0123456789abcdef";
data/xpdf-3.04/goo/GString.cc:705: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(s+i, str->c_str(), n);
data/xpdf-3.04/goo/GString.cc:720: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(s+i, str, n);
data/xpdf-3.04/goo/GString.cc:734: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(s+i, str, lengthA);
data/xpdf-3.04/goo/gfile.cc:356: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 buf[PATH_MAX+1];
data/xpdf-3.04/goo/gfile.cc:367: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 buf[_MAX_PATH];
data/xpdf-3.04/goo/gfile.cc:392: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 buf[PATH_MAX+1];
data/xpdf-3.04/goo/gmem.cc:128: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(q, p, size < oldSize ? size : oldSize);
data/xpdf-3.04/goo/parseargs.c:111: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).
      *(int *)arg->val = atoi(argv[i+1]);
data/xpdf-3.04/splash/Splash.cc:2075: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(state->matrix, matrix, 6 * sizeof(SplashCoord));
data/xpdf-3.04/splash/Splash.cc:3173: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(scanBuf + xMin, p, xMax - xMin + 1);
data/xpdf-3.04/splash/Splash.cc:4135: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(lineBuf1, lineBuf0, srcWidth);
data/xpdf-3.04/splash/Splash.cc:4252: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(scanBuf + x0,
data/xpdf-3.04/splash/Splash.cc:5511: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 pix[splashMaxColorComps];
data/xpdf-3.04/splash/Splash.cc:5537: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(lineBuf1, lineBuf0, srcWidth * nComps);
data/xpdf-3.04/splash/Splash.cc:5539: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(alphaLineBuf1, alphaLineBuf0, srcWidth);
data/xpdf-3.04/splash/Splash.cc:5687: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(lineBuf, p0, w);
data/xpdf-3.04/splash/Splash.cc:5688: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(p0, p1, w);
data/xpdf-3.04/splash/Splash.cc:5689: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(p1, lineBuf, w);
data/xpdf-3.04/splash/Splash.cc:5695: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(lineBuf, p0, width);
data/xpdf-3.04/splash/Splash.cc:5696: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(p0, p1, width);
data/xpdf-3.04/splash/Splash.cc:5697: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(p1, lineBuf, width);
data/xpdf-3.04/splash/Splash.cc:5712: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(lineBuf, p0, w);
data/xpdf-3.04/splash/Splash.cc:5725: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(lineBuf, p0, width);
data/xpdf-3.04/splash/Splash.cc:5844: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(scanBuf + xDest,
data/xpdf-3.04/splash/Splash.cc:5929: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(scanBuf + x0,
data/xpdf-3.04/splash/Splash.cc:6091: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(p, q, w);
data/xpdf-3.04/splash/Splash.cc:6099: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(p, q, 3 * w);
data/xpdf-3.04/splash/Splash.cc:6107: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(p, q, 4 * w);
data/xpdf-3.04/splash/Splash.h:413: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 aaGamma[256];
data/xpdf-3.04/splash/SplashBitmap.cc:95:13:  [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 (!(f = fopen(fileName, "wb"))) {
data/xpdf-3.04/splash/SplashBitmap.cc:172:13:  [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 (!(f = fopen(fileName, "wb"))) {
data/xpdf-3.04/splash/SplashFTFont.cc:294: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(p, q, rowSize);
data/xpdf-3.04/splash/SplashFont.cc:168: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(p, bitmap2.data, size);
data/xpdf-3.04/splash/SplashPath.cc:49: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(pts, path->pts, length * sizeof(SplashPathPoint));
data/xpdf-3.04/splash/SplashPath.cc:50: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(flags, path->flags, length * sizeof(unsigned char));
data/xpdf-3.04/splash/SplashPath.cc:55: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(hints, path->hints, hintsLength * sizeof(SplashPathHint));
data/xpdf-3.04/splash/SplashScreen.cc:372: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(mat, screen->mat, size * size * sizeof(unsigned char));
data/xpdf-3.04/splash/SplashState.cc:124: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(matrix, state->matrix, 6 * sizeof(SplashCoord));
data/xpdf-3.04/splash/SplashState.cc:139: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(lineDash, state->lineDash, lineDashLength * sizeof(SplashCoord));
data/xpdf-3.04/splash/SplashState.cc:152: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(rgbTransferR, state->rgbTransferR, 256);
data/xpdf-3.04/splash/SplashState.cc:153: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(rgbTransferG, state->rgbTransferG, 256);
data/xpdf-3.04/splash/SplashState.cc:154: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(rgbTransferB, state->rgbTransferB, 256);
data/xpdf-3.04/splash/SplashState.cc:155: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(grayTransfer, state->grayTransfer, 256);
data/xpdf-3.04/splash/SplashState.cc:156: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(cmykTransferC, state->cmykTransferC, 256);
data/xpdf-3.04/splash/SplashState.cc:157: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(cmykTransferM, state->cmykTransferM, 256);
data/xpdf-3.04/splash/SplashState.cc:158: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(cmykTransferY, state->cmykTransferY, 256);
data/xpdf-3.04/splash/SplashState.cc:159: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(cmykTransferK, state->cmykTransferK, 256);
data/xpdf-3.04/splash/SplashState.cc:198: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(lineDash, lineDashA, lineDashLength * sizeof(SplashCoord));
data/xpdf-3.04/splash/SplashState.cc:243: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(rgbTransferR, red, 256);
data/xpdf-3.04/splash/SplashState.cc:244: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(rgbTransferG, green, 256);
data/xpdf-3.04/splash/SplashState.cc:245: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(rgbTransferB, blue, 256);
data/xpdf-3.04/splash/SplashState.cc:246: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(grayTransfer, gray, 256);
data/xpdf-3.04/splash/SplashState.h:111: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 rgbTransferR[256],
data/xpdf-3.04/splash/SplashState.h:114: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 grayTransfer[256];
data/xpdf-3.04/splash/SplashState.h:115: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 cmykTransferC[256],
data/xpdf-3.04/splash/SplashTypes.h:62:18:  [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.
typedef unsigned char SplashColor[splashMaxColorComps];
data/xpdf-3.04/splash/SplashXPath.cc:267: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(segs, xPath->segs, length * sizeof(SplashXPathSeg));
data/xpdf-3.04/xpdf/AcroForm.cc:389: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(ret, u, n * sizeof(Unicode));
data/xpdf-3.04/xpdf/AcroForm.cc:415: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(u, ts->getUnicode(), n * sizeof(Unicode));
data/xpdf-3.04/xpdf/CMap.cc:122: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 tok1[256], tok2[256], tok3[256];
data/xpdf-3.04/xpdf/CMap.cc:135:15:  [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).
      wMode = atoi(tok2);
data/xpdf-3.04/xpdf/CMap.cc:158:31:  [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).
	addCIDs(code, code, n1, (CID)atoi(tok2));
data/xpdf-3.04/xpdf/CMap.cc:179:33:  [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).
	  addCIDs(start, end, n1, (CID)atoi(tok3));
data/xpdf-3.04/xpdf/Catalog.cc:245: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 buf[4096];
data/xpdf-3.04/xpdf/CharCodeToUnicode.cc:103: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 buf[64];
data/xpdf-3.04/xpdf/CharCodeToUnicode.cc:146: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 buf[256];
data/xpdf-3.04/xpdf/CharCodeToUnicode.cc:255: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 tok1[256], tok2[256], tok3[256];
data/xpdf-3.04/xpdf/CharCodeToUnicode.cc:466: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(map, mapA, mapLen * sizeof(Unicode));
data/xpdf-3.04/xpdf/CompactFontTables.h:12: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.
static char *type1CStdStrings[391] = {
data/xpdf-3.04/xpdf/Decrypt.cc:26: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 passwordPad[32] = {
data/xpdf-3.04/xpdf/Decrypt.cc:45: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 test[127 + 56], test2[32];
data/xpdf-3.04/xpdf/Decrypt.cc:48: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 fState[256];
data/xpdf-3.04/xpdf/Decrypt.cc:49: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 tmpKey[16];
data/xpdf-3.04/xpdf/Decrypt.cc:64: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(test, ownerPassword->c_str(), len);
data/xpdf-3.04/xpdf/Decrypt.cc:65: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(test + len, ownerKey->c_str() + 32, 8);
data/xpdf-3.04/xpdf/Decrypt.cc:66: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(test + len + 8, userKey->c_str(), 48);
data/xpdf-3.04/xpdf/Decrypt.cc:75: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(test, ownerPassword->c_str(), len);
data/xpdf-3.04/xpdf/Decrypt.cc:76: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(test + len, ownerKey->c_str() + 40, 8);
data/xpdf-3.04/xpdf/Decrypt.cc:77: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(test + len + 8, userKey->c_str(), 48);
data/xpdf-3.04/xpdf/Decrypt.cc:88: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(fileKey, state.buf, 16);
data/xpdf-3.04/xpdf/Decrypt.cc:91: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(fileKey + 16, state.buf, 16);
data/xpdf-3.04/xpdf/Decrypt.cc:110: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(test, userPW, len);
data/xpdf-3.04/xpdf/Decrypt.cc:111: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(test + len, userKey->c_str() + 32, 8);
data/xpdf-3.04/xpdf/Decrypt.cc:119: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(test, userPW, len);
data/xpdf-3.04/xpdf/Decrypt.cc:120: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(test + len, userKey->c_str() + 40, 8);
data/xpdf-3.04/xpdf/Decrypt.cc:130: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(fileKey, state.buf, 16);
data/xpdf-3.04/xpdf/Decrypt.cc:133: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(fileKey + 16, state.buf, 16);
data/xpdf-3.04/xpdf/Decrypt.cc:146: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(test, ownerPassword->c_str(), len);
data/xpdf-3.04/xpdf/Decrypt.cc:147: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(test + len, passwordPad, 32 - len);
data/xpdf-3.04/xpdf/Decrypt.cc:149: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(test, ownerPassword->c_str(), 32);
data/xpdf-3.04/xpdf/Decrypt.cc:164: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(test2, ownerKey->c_str(), 32);
data/xpdf-3.04/xpdf/Decrypt.cc:196: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 key1[64*(127+64+48)];
data/xpdf-3.04/xpdf/Decrypt.cc:202: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(key1, pwd, pwdLen);
data/xpdf-3.04/xpdf/Decrypt.cc:203: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(key1 + pwdLen, key, keyLen);
data/xpdf-3.04/xpdf/Decrypt.cc:206: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(key1 + pwdLen + keyLen, userKey, 48);
data/xpdf-3.04/xpdf/Decrypt.cc:210: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(key1 + j * n, key1, n);
data/xpdf-3.04/xpdf/Decrypt.cc:219: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(key1 + j, state128.buf, 16);
data/xpdf-3.04/xpdf/Decrypt.cc:255: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 test[32];
data/xpdf-3.04/xpdf/Decrypt.cc:256: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 fState[256];
data/xpdf-3.04/xpdf/Decrypt.cc:257: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 tmpKey[16];
data/xpdf-3.04/xpdf/Decrypt.cc:267: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(buf, userPassword->c_str(), len);
data/xpdf-3.04/xpdf/Decrypt.cc:268: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(buf + len, passwordPad, 32 - len);
data/xpdf-3.04/xpdf/Decrypt.cc:270: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(buf, userPassword->c_str(), 32);
data/xpdf-3.04/xpdf/Decrypt.cc:273: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(buf, passwordPad, 32);
data/xpdf-3.04/xpdf/Decrypt.cc:275: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(buf + 32, ownerKey->c_str(), 32);
data/xpdf-3.04/xpdf/Decrypt.cc:280: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(buf + 68, fileID->c_str(), fileID->getLength());
data/xpdf-3.04/xpdf/Decrypt.cc:304: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(test, userKey->c_str(), 32);
data/xpdf-3.04/xpdf/Decrypt.cc:315: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(buf, passwordPad, 32);
data/xpdf-3.04/xpdf/Decrypt.cc:316: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(buf + 32, fileID->c_str(), fileID->getLength());
data/xpdf-3.04/xpdf/Decrypt.cc:403: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 in[16];
data/xpdf-3.04/xpdf/Decrypt.cc:450: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 in[16];
data/xpdf-3.04/xpdf/Decrypt.cc:536: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 sbox[256] = {
data/xpdf-3.04/xpdf/Decrypt.cc:555: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 invSbox[256] = {
data/xpdf-3.04/xpdf/Decrypt.cc:1118: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(state->buf + state->bufLen, p, k);
data/xpdf-3.04/xpdf/Decrypt.cc:1125: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(state->buf + state->bufLen, p, remain);
data/xpdf-3.04/xpdf/Decrypt.cc:1292: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 blk[64];
data/xpdf-3.04/xpdf/Decrypt.cc:1311: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(blk, msg + i, blkLen);
data/xpdf-3.04/xpdf/Decrypt.cc:1481: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 blk[128];
data/xpdf-3.04/xpdf/Decrypt.cc:1500: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(blk, msg + i, blkLen);
data/xpdf-3.04/xpdf/Decrypt.cc:1547: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 blk[128];
data/xpdf-3.04/xpdf/Decrypt.cc:1566: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(blk, msg + i, blkLen);
data/xpdf-3.04/xpdf/Decrypt.h:58: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 state[256];
data/xpdf-3.04/xpdf/Decrypt.h:65: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 state[16];
data/xpdf-3.04/xpdf/Decrypt.h:66: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 cbc[16];
data/xpdf-3.04/xpdf/Decrypt.h:67: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 buf[16];
data/xpdf-3.04/xpdf/Decrypt.h:73: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 state[16];
data/xpdf-3.04/xpdf/Decrypt.h:74: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 cbc[16];
data/xpdf-3.04/xpdf/Decrypt.h:75: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 buf[16];
data/xpdf-3.04/xpdf/Decrypt.h:97: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 objKey[32];
data/xpdf-3.04/xpdf/Decrypt.h:110: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 buf[64];
data/xpdf-3.04/xpdf/Decrypt.h:113: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 digest[16];
data/xpdf-3.04/xpdf/FontEncodingTables.cc:13:7:  [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 *macRomanEncoding[256] = {
data/xpdf-3.04/xpdf/FontEncodingTables.cc:272:7:  [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 *macExpertEncoding[256] = {
data/xpdf-3.04/xpdf/FontEncodingTables.cc:531:7:  [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 *winAnsiEncoding[256] = {
data/xpdf-3.04/xpdf/FontEncodingTables.cc:790:7:  [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 *standardEncoding[256] = {
data/xpdf-3.04/xpdf/FontEncodingTables.cc:1049:7:  [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 *expertEncoding[256] = {
data/xpdf-3.04/xpdf/FontEncodingTables.cc:1308:7:  [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 *symbolEncoding[256] = {
data/xpdf-3.04/xpdf/FontEncodingTables.cc:1567:7:  [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 *zapfDingbatsEncoding[256] = {
data/xpdf-3.04/xpdf/Function.cc:410: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(this, func, sizeof(SampledFunction));
data/xpdf-3.04/xpdf/Function.cc:412: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(idxOffset, func->idxOffset, (1 << m) * (int)sizeof(int));
data/xpdf-3.04/xpdf/Function.cc:414: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(samples, func->samples, nSamples * sizeof(double));
data/xpdf-3.04/xpdf/Function.cc:587: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(this, func, sizeof(ExponentialFunction));
data/xpdf-3.04/xpdf/Function.cc:728: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(this, func, sizeof(StitchingFunction));
data/xpdf-3.04/xpdf/Function.cc:734: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(bounds, func->bounds, (k + 1) * sizeof(double));
data/xpdf-3.04/xpdf/Function.cc:736: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(encode, func->encode, 2 * k * sizeof(double));
data/xpdf-3.04/xpdf/Function.cc:738: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(scale, func->scale, k * sizeof(double));
data/xpdf-3.04/xpdf/Function.cc:952: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(this, func, sizeof(PostScriptFunction));
data/xpdf-3.04/xpdf/Function.cc:955: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(code, func->code, codeSize * sizeof(PSCode));
data/xpdf-3.04/xpdf/Gfx.cc:4782: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(dash2, dash, dashLength * sizeof(double));
data/xpdf-3.04/xpdf/Gfx.h:72: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 name[4];
data/xpdf-3.04/xpdf/GfxFont.cc:118: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 *base14SubstFonts[14] = {
data/xpdf-3.04/xpdf/GfxFont.cc:495: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 buf2[4096];
data/xpdf-3.04/xpdf/GfxFont.cc:1072:15:  [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.
    enc[i] = (char *)baseEnc[i];
data/xpdf-3.04/xpdf/GfxFont.cc:1085: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.
	enc[i] = (char *)standardEncoding[i];
data/xpdf-3.04/xpdf/GfxFont.cc:1186:12:  [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).
	  code2 = atoi(charName);
data/xpdf-3.04/xpdf/GfxFont.cc:1189:12:  [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).
	  code2 = atoi(charName+1);
data/xpdf-3.04/xpdf/GfxFont.cc:1192:12:  [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).
	  code2 = atoi(charName+2);
data/xpdf-3.04/xpdf/GfxFont.h:281: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 *enc[256];		// char code --> char name
data/xpdf-3.04/xpdf/GfxFont.h:282: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 encFree[256];		// boolean for each char name: if set,
data/xpdf-3.04/xpdf/GfxState.cc:1019: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(cs->lookup, lookup,
data/xpdf-3.04/xpdf/GfxState.cc:2521: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(vertices, shading->vertices, nVertices * sizeof(GfxGouraudVertex));
data/xpdf-3.04/xpdf/GfxState.cc:2524: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(triangles, shading->triangles, nTriangles * 3 * sizeof(int));
data/xpdf-3.04/xpdf/GfxState.cc:2833: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(patches, shading->patches, nPatches * sizeof(GfxPatch));
data/xpdf-3.04/xpdf/GfxState.cc:3543: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(lookup[k], colorMap->lookup[k], n * sizeof(GfxColorComp));
data/xpdf-3.04/xpdf/GfxState.cc:3549: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(lookup2[k], colorMap->lookup2[k], n * sizeof(GfxColorComp));
data/xpdf-3.04/xpdf/GfxState.cc:3555: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(lookup2[k], colorMap->lookup2[k], n * sizeof(GfxColorComp));
data/xpdf-3.04/xpdf/GfxState.cc:3751: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(x, subpath->x, n * sizeof(double));
data/xpdf-3.04/xpdf/GfxState.cc:3752: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(y, subpath->y, n * sizeof(double));
data/xpdf-3.04/xpdf/GfxState.cc:3753: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(curve, subpath->curve, n * sizeof(GBool));
data/xpdf-3.04/xpdf/GfxState.cc:4054: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(this, state, sizeof(GfxState));
data/xpdf-3.04/xpdf/GfxState.cc:4074: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(lineDash, state->lineDash, lineDashLength * sizeof(double));
data/xpdf-3.04/xpdf/GlobalParams.cc:839: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 (!(f = fopen(fileName->c_str(), "r"))) {
data/xpdf-3.04/xpdf/GlobalParams.cc:845: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 (!(f = fopen(fileName->c_str(), "r"))) {
data/xpdf-3.04/xpdf/GlobalParams.cc:851: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 buf[512];
data/xpdf-3.04/xpdf/GlobalParams.cc:862: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 (!(f = fopen(fileName->c_str(), "r"))) {
data/xpdf-3.04/xpdf/GlobalParams.cc:1008: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 buf[512];
data/xpdf-3.04/xpdf/GlobalParams.cc:1460:20:  [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).
    psPaperWidth = atoi(tok->c_str());
data/xpdf-3.04/xpdf/GlobalParams.cc:1462: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).
    psPaperHeight = atoi(tok->c_str());
data/xpdf-3.04/xpdf/GlobalParams.cc:1480:20:  [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).
  psImageableLLX = atoi(((GString *)(*tokens)[1])->c_str());
data/xpdf-3.04/xpdf/GlobalParams.cc:1481:20:  [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).
  psImageableLLY = atoi(((GString *)(*tokens)[2])->c_str());
data/xpdf-3.04/xpdf/GlobalParams.cc:1482:20:  [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).
  psImageableURX = atoi(((GString *)(*tokens)[3])->c_str());
data/xpdf-3.04/xpdf/GlobalParams.cc:1483:20:  [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).
  psImageableURY = atoi(((GString *)(*tokens)[4])->c_str());
data/xpdf-3.04/xpdf/GlobalParams.cc:1773:14:  [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).
	     (btn = atoi(p0 + 10)) >= 1 && btn <= 32) {
data/xpdf-3.04/xpdf/GlobalParams.cc:1778:14:  [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).
	     (btn = atoi(p0 + 12)) >= 1 && btn <= 32) {
data/xpdf-3.04/xpdf/GlobalParams.cc:1915:10:  [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).
  *val = atoi(tok->c_str());
data/xpdf-3.04/xpdf/ImageOutputDev.cc:53: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 buf[4096];
data/xpdf-3.04/xpdf/ImageOutputDev.cc:62: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 (!(f = fopen(fileName, "wb"))) {
data/xpdf-3.04/xpdf/ImageOutputDev.cc:85: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 (!(f = fopen(fileName, "wb"))) {
data/xpdf-3.04/xpdf/ImageOutputDev.cc:122: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 buf[4096];
data/xpdf-3.04/xpdf/ImageOutputDev.cc:134: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 (!(f = fopen(fileName, "wb"))) {
data/xpdf-3.04/xpdf/ImageOutputDev.cc:158: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 (!(f = fopen(fileName, "wb"))) {
data/xpdf-3.04/xpdf/ImageOutputDev.cc:189: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 (!(f = fopen(fileName, "wb"))) {
data/xpdf-3.04/xpdf/JArithmeticDecoder.cc:37: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(stats->cxTab, cxTab, contextSize);
data/xpdf-3.04/xpdf/JArithmeticDecoder.cc:46: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(cxTab, stats->cxTab, contextSize);
data/xpdf-3.04/xpdf/JBIG2Stream.cc:733: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, bitmap->data, h * line);
data/xpdf-3.04/xpdf/JBIG2Stream.cc:820: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 + yDest * line, data + ySrc * line, line);
data/xpdf-3.04/xpdf/Lexer.cc:26: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.
static char specialChars[256] = {
data/xpdf-3.04/xpdf/Lexer.h:76: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 tokBuf[tokBufSize];	// temporary token buffer
data/xpdf-3.04/xpdf/Link.cc:675: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 buf[4096];
data/xpdf-3.04/xpdf/Object.cc:27:7:  [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 *objTypeNames[numObjTypes] = {
data/xpdf-3.04/xpdf/Outline.cc:164:19:  [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).
void OutlineItem::open() {
data/xpdf-3.04/xpdf/Outline.h:54:8:  [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).
  void open();
data/xpdf-3.04/xpdf/PDFCore.cc:926: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(tile->ctm, out->getDefCTM(), 6 * sizeof(double));
data/xpdf-3.04/xpdf/PDFCore.cc:927: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(tile->ictm, out->getDefICTM(), 6 * sizeof(double));
data/xpdf-3.04/xpdf/PDFCore.cc:2055: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(core->curTile->ctm, core->out->getDefCTM(), 6 * sizeof(double));
data/xpdf-3.04/xpdf/PDFCore.cc:2056: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(core->curTile->ictm, core->out->getDefICTM(), 6 * sizeof(double));
data/xpdf-3.04/xpdf/PDFDoc.cc:88: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 (!(file = fopen(fileName1->c_str(), "rb", "ctx=stm"))) {
data/xpdf-3.04/xpdf/PDFDoc.cc:94: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 (!(file = fopen(fileName1->c_str(), "rb"))) {
data/xpdf-3.04/xpdf/PDFDoc.cc:97:18:  [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 (!(file = fopen(fileName2->c_str(), "rb"))) {
data/xpdf-3.04/xpdf/PDFDoc.cc:99:20:  [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 (!(file = fopen(fileName2->c_str(), "rb"))) {
data/xpdf-3.04/xpdf/PDFDoc.cc:154: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 = fopen(fileName->c_str(), "rb");
data/xpdf-3.04/xpdf/PDFDoc.cc:308: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 hdrBuf[headerSearchSize+1];
data/xpdf-3.04/xpdf/PDFDoc.cc:457: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 buf[4096];
data/xpdf-3.04/xpdf/PDFDoc.cc:460:13:  [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 (!(f = fopen(name->c_str(), "wb"))) {
data/xpdf-3.04/xpdf/PDFDoc.cc:477:13:  [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 (!(f = fopen(path, "wb"))) {
data/xpdf-3.04/xpdf/PDFDoc.cc:489: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 path2w[_MAX_PATH + 1];
data/xpdf-3.04/xpdf/PDFDoc.cc:490: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 path2c[_MAX_PATH + 1];
data/xpdf-3.04/xpdf/PDFDoc.cc:508:9:  [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).
    f = fopen(path2c, "wb");
data/xpdf-3.04/xpdf/PDFDoc.cc:521: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 buf[4096];
data/xpdf-3.04/xpdf/PSOutputDev.cc:1004: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 pixBuf[gfxColorMaxComps];
data/xpdf-3.04/xpdf/PSOutputDev.cc:1089: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 (!(f = fopen(fileName, "w"))) {
data/xpdf-3.04/xpdf/PSOutputDev.cc:1782: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 buf[16];
data/xpdf-3.04/xpdf/PSOutputDev.cc:1952:4:  [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(buf, "c%02x", i+j);
data/xpdf-3.04/xpdf/PSOutputDev.cc:1973: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.
  static char hexChar[17] = "0123456789abcdef";
data/xpdf-3.04/xpdf/PSOutputDev.cc:2166: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.
  static char hexChar[17] = "0123456789abcdef";
data/xpdf-3.04/xpdf/PSOutputDev.cc:2193:20:  [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 (!(fontFile = fopen(fileName->c_str(), "rb"))) {
data/xpdf-3.04/xpdf/PSOutputDev.cc:2604: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(ff->codeToGID, codeToGID, codeToGIDLen * sizeof(int));
data/xpdf-3.04/xpdf/PSOutputDev.cc:2792: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(ff->codeToGID, ((GfxCIDFont *)font)->getCIDToGID(), n * sizeof(int));
data/xpdf-3.04/xpdf/PSOutputDev.cc:3264: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 col[4];
data/xpdf-3.04/xpdf/PSOutputDev.cc:3265: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 buf[4096];
data/xpdf-3.04/xpdf/PSOutputDev.cc:4644: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 buf[8];
data/xpdf-3.04/xpdf/PSOutputDev.cc:4897: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 pixBuf[gfxColorMaxComps];
data/xpdf-3.04/xpdf/PSOutputDev.cc:5009: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 pixBuf[gfxColorMaxComps];
data/xpdf-3.04/xpdf/PSOutputDev.cc:5080: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 buf[4096];
data/xpdf-3.04/xpdf/PSOutputDev.cc:5619: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 buf[4096];
data/xpdf-3.04/xpdf/PSOutputDev.cc:6725: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 buf[4096];
data/xpdf-3.04/xpdf/PSOutputDev.cc:6936: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 buf[8];
data/xpdf-3.04/xpdf/PSOutputDev.cc:6951:7:  [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(buf, "\\%03o", *p);
data/xpdf-3.04/xpdf/PSOutputDev.cc:6981: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 buf[8];
data/xpdf-3.04/xpdf/PSOutputDev.cc:7001:7:  [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(buf, "#%02x", c & 0xff);
data/xpdf-3.04/xpdf/PSTokenizer.cc:23: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.
static char specialChars[256] = {
data/xpdf-3.04/xpdf/SecurityHandler.cc:433: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(fileKey, key, fileKeyLength);
data/xpdf-3.04/xpdf/SecurityHandler.h:113: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 fileKey[32];
data/xpdf-3.04/xpdf/SecurityHandler.h:156: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 fileKey[16];
data/xpdf-3.04/xpdf/SplashOutputDev.cc:1058: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 red[256], green[256], blue[256], gray[256];
data/xpdf-3.04/xpdf/SplashOutputDev.cc:1122: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 blk[4096];
data/xpdf-3.04/xpdf/SplashOutputDev.cc:1227:27:  [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 (!(extFontFile = fopen(fontLoc->path->c_str(), "rb"))) {
data/xpdf-3.04/xpdf/SplashOutputDev.cc:1371: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(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
data/xpdf-3.04/xpdf/SplashOutputDev.cc:1401: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(codeToGID, ((GfxCIDFont *)gfxFont)->getCIDToGID(),
data/xpdf-3.04/xpdf/SplashOutputDev.cc:2054: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(t3GlyphStack->cacheData, bitmap->getDataPtr(),
data/xpdf-3.04/xpdf/SplashOutputDev.cc:2618:19:  [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 bitToByte[2] = {0x00, 0xff};
data/xpdf-3.04/xpdf/SplashOutputDev.cc:3476: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 blk[4096];
data/xpdf-3.04/xpdf/SplashOutputDev.cc:3513:27:  [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 (!(extFontFile = fopen(fontLoc->path->c_str(), "rb"))) {
data/xpdf-3.04/xpdf/Stream.cc:102: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 buf[4096];
data/xpdf-3.04/xpdf/Stream.cc:528: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(blk + n, predLine + predIdx, m);
data/xpdf-3.04/xpdf/Stream.cc:537: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 upLeftBuf[gfxColorMaxComps * 2 + 1];
data/xpdf-3.04/xpdf/Stream.cc:710: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(blk + n, bufPtr, m);
data/xpdf-3.04/xpdf/Stream.cc:821: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(blk, bufPtr, n);
data/xpdf-3.04/xpdf/Stream.cc:1171: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(blk + n, seqBuf + seqIndex, m);
data/xpdf-3.04/xpdf/Stream.cc:1335: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(blk + n, bufPtr, m);
data/xpdf-3.04/xpdf/Stream.cc:2034: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 s1[50];
data/xpdf-3.04/xpdf/Stream.cc:2044: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(s1, "/K %d ", encoding);
data/xpdf-3.04/xpdf/Stream.cc:2053: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(s1, "/Columns %d ", columns);
data/xpdf-3.04/xpdf/Stream.cc:2056: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(s1, "/Rows %d ", rows);
data/xpdf-3.04/xpdf/Stream.cc:2114: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 dctClipData[1024];
data/xpdf-3.04/xpdf/Stream.cc:2360: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 data2[64];
data/xpdf-3.04/xpdf/Stream.cc:2800: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 dataOut[64];
data/xpdf-3.04/xpdf/Stream.cc:2941:32:  [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.
				  int dataIn[64], unsigned char dataOut[64]) {
data/xpdf-3.04/xpdf/Stream.cc:3474: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 buf[5];
data/xpdf-3.04/xpdf/Stream.cc:3504: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 buf[12];
data/xpdf-3.04/xpdf/Stream.cc:4868: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 buf1[5];
data/xpdf-3.04/xpdf/Stream.h:321: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 buf[fileStreamBufSize];
data/xpdf-3.04/xpdf/Stream.h:480: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 seqBuf[4097];		// buffer for current sequence
data/xpdf-3.04/xpdf/Stream.h:511: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 buf[128];		// buffer
data/xpdf-3.04/xpdf/Stream.h:594: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 firstSym[17];		// first symbol for this bit length
data/xpdf-3.04/xpdf/Stream.h:597: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 sym[256];		// symbols
data/xpdf-3.04/xpdf/Stream.h:658:30:  [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.
			 int dataIn[64], unsigned char dataOut[64]);
data/xpdf-3.04/xpdf/Stream.h:722: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 buf[flateWindow];	// output data buffer
data/xpdf-3.04/xpdf/Stream.h:846: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 buf[4];
data/xpdf-3.04/xpdf/Stream.h:877: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 buf[8];
data/xpdf-3.04/xpdf/Stream.h:908: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 buf[131];
data/xpdf-3.04/xpdf/Stream.h:946: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 inBuf[4096];
data/xpdf-3.04/xpdf/TextOutputDev.cc:586: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(text, word->text, len * sizeof(Unicode));
data/xpdf-3.04/xpdf/TextOutputDev.cc:588: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(edge, word->edge, (len + 1) * sizeof(double));
data/xpdf-3.04/xpdf/TextOutputDev.cc:590: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(charPos, word->charPos, (len + 1) * sizeof(int));
data/xpdf-3.04/xpdf/TextOutputDev.cc:662: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 buf[8];
data/xpdf-3.04/xpdf/TextOutputDev.cc:1236: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(actualText, u, uLen * sizeof(Unicode));
data/xpdf-3.04/xpdf/TextOutputDev.cc:1280: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 space[8], eol[16], eop[8];
data/xpdf-3.04/xpdf/TextOutputDev.cc:1512: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 buf[8];
data/xpdf-3.04/xpdf/TextOutputDev.cc:1637: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 buf[8];
data/xpdf-3.04/xpdf/TextOutputDev.cc:1713: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 lre[8], rle[8], popdf[8], buf[8];
data/xpdf-3.04/xpdf/TextOutputDev.cc:3476: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 buf[8];
data/xpdf-3.04/xpdf/TextOutputDev.cc:3875: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 space[8], eol[16];
data/xpdf-3.04/xpdf/TextOutputDev.cc:4204: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).
    } else if ((outputStream = fopen(fileName, append ? "ab" : "wb"))) {
data/xpdf-3.04/xpdf/TextString.cc:38: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(u, s->u, len * sizeof(Unicode));
data/xpdf-3.04/xpdf/UnicodeMap.cc:31: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 code[maxExtCode];
data/xpdf-3.04/xpdf/UnicodeMap.cc:43: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 buf[256];
data/xpdf-3.04/xpdf/XFAForm.cc:37: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 code3Of9Data[128][10] = {
data/xpdf-3.04/xpdf/XFAForm.cc:180: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 buf[4096];
data/xpdf-3.04/xpdf/XFAForm.cc:541:11:  [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).
    rot = atoi(attr->getValue()->c_str());
data/xpdf-3.04/xpdf/XFAForm.cc:708:16:  [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).
    maxChars = atoi(attr->getValue()->c_str());
data/xpdf-3.04/xpdf/XFAForm.cc:721:14:  [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).
	combCells = atoi(attr->getValue()->c_str());
data/xpdf-3.04/xpdf/XFAForm.cc:830:20:  [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).
      dataLength = atoi(attr->getValue()->c_str());
data/xpdf-3.04/xpdf/XFAForm.cc:1062:10:  [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).
	  idx = atoi(partName + n + 1);
data/xpdf-3.04/xpdf/XPDFApp.cc:222: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).
XPDFViewer *XPDFApp::open(const GString *fileName, int page,
data/xpdf-3.04/xpdf/XPDFApp.cc:342: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 cmd2[remoteCmdSize];
data/xpdf-3.04/xpdf/XPDFApp.cc:349: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(cmd2, cmd, n);
data/xpdf-3.04/xpdf/XPDFApp.cc:358: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 cmd[remoteCmdSize];
data/xpdf-3.04/xpdf/XPDFApp.cc:360: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(cmd, "openFileAtPage(%.200s,%d)\n",
data/xpdf-3.04/xpdf/XPDFApp.cc:363: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(cmd, "raise\n");
data/xpdf-3.04/xpdf/XPDFApp.cc:371: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 cmd[remoteCmdSize];
data/xpdf-3.04/xpdf/XPDFApp.cc:373: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(cmd, "openFileAtDest(%.200s,%.256s)\n",
data/xpdf-3.04/xpdf/XPDFApp.cc:376: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(cmd, "raise\n");
data/xpdf-3.04/xpdf/XPDFApp.cc:384: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 cmd[remoteCmdSize];
data/xpdf-3.04/xpdf/XPDFApp.cc:386: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(cmd, "reload\n");
data/xpdf-3.04/xpdf/XPDFApp.cc:388: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(cmd, "raise\n");
data/xpdf-3.04/xpdf/XPDFApp.h:43: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).
  XPDFViewer *open(const GString *fileName, int page = 1,
data/xpdf-3.04/xpdf/XPDFCore.cc:134:14:  [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).
      zoom = atoi(initialZoom->c_str());
data/xpdf-3.04/xpdf/XPDFCore.cc:792: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 buf[4];
data/xpdf-3.04/xpdf/XPDFCore.cc:801:7:  [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(buf, "%%%02x", c & 0xff);
data/xpdf-3.04/xpdf/XPDFViewer.cc:402:18:  [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).
void XPDFViewer::open(GString *fileName, int pageA, GString *destName) {
data/xpdf-3.04/xpdf/XPDFViewer.cc:537:19:  [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).
	newViewer = app->open(core->getDoc()->getFileName());
data/xpdf-3.04/xpdf/XPDFViewer.cc:970:8:  [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).
  pg = atoi(args[0]->c_str());
data/xpdf-3.04/xpdf/XPDFViewer.cc:981:8:  [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).
  pg = atoi(args[0]->c_str());
data/xpdf-3.04/xpdf/XPDFViewer.cc:1005:3:  [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).
  open(args[0], 1, NULL);
data/xpdf-3.04/xpdf/XPDFViewer.cc:1010:3:  [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).
  open(args[0], 1, args[1]);
data/xpdf-3.04/xpdf/XPDFViewer.cc:1020:3:  [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).
  open(args[0], atoi(args[1]->c_str()), NULL);
data/xpdf-3.04/xpdf/XPDFViewer.cc:1020:17:  [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).
  open(args[0], atoi(args[1]->c_str()), NULL);
data/xpdf-3.04/xpdf/XPDFViewer.cc:1025:8:  [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).
  app->open(args[0], atoi(args[1]->c_str()));
data/xpdf-3.04/xpdf/XPDFViewer.cc:1025: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).
  app->open(args[0], atoi(args[1]->c_str()));
data/xpdf-3.04/xpdf/XPDFViewer.cc:1030:8:  [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).
  app->open(args[0]);
data/xpdf-3.04/xpdf/XPDFViewer.cc:1148: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 buf[64];
data/xpdf-3.04/xpdf/XPDFViewer.cc:1187:4:  [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(buf, "%d", core->getPageNum());
data/xpdf-3.04/xpdf/XPDFViewer.cc:1203: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(buf, "%g",
data/xpdf-3.04/xpdf/XPDFViewer.cc:1226:4:  [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(buf, "%d", mousePage);
data/xpdf-3.04/xpdf/XPDFViewer.cc:1228:4:  [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(buf, "%g", (c1 == 'j') ? mouseX : mouseY);
data/xpdf-3.04/xpdf/XPDFViewer.cc:1258:20:  [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).
  core->scrollDown(atoi(args[0]->c_str()));
data/xpdf-3.04/xpdf/XPDFViewer.cc:1263:28:  [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).
  core->scrollDownNextPage(atoi(args[0]->c_str()));
data/xpdf-3.04/xpdf/XPDFViewer.cc:1268:20:  [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).
  core->scrollLeft(atoi(args[0]->c_str()));
data/xpdf-3.04/xpdf/XPDFViewer.cc:1284:23:  [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).
    if ((val += inc * atoi(args[0]->c_str())) > m - slider) {
data/xpdf-3.04/xpdf/XPDFViewer.cc:1305:23:  [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).
    if ((val -= inc * atoi(args[0]->c_str())) < m) {
data/xpdf-3.04/xpdf/XPDFViewer.cc:1315: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).
  core->scrollRight(atoi(args[0]->c_str()));
data/xpdf-3.04/xpdf/XPDFViewer.cc:1350:18:  [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).
  core->scrollUp(atoi(args[0]->c_str()));
data/xpdf-3.04/xpdf/XPDFViewer.cc:1355: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).
  core->scrollUpPrevPage(atoi(args[0]->c_str()));
data/xpdf-3.04/xpdf/XPDFViewer.cc:1361:8:  [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).
  pg = atoi(args[0]->c_str());
data/xpdf-3.04/xpdf/XPDFViewer.cc:1837: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.
    st[i] = XmStringCreateLocalized((char *)zoomMenuInfo[i].label);
data/xpdf-3.04/xpdf/XPDFViewer.cc:1852: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 buf[16];
data/xpdf-3.04/xpdf/XPDFViewer.cc:1857: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.
    s = XmStringCreateLocalized((char *)zoomMenuInfo[i].label);
data/xpdf-3.04/xpdf/XPDFViewer.cc:1860: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(buf, "zoom%d", i);
data/xpdf-3.04/xpdf/XPDFViewer.cc:2399: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 buf[32];
data/xpdf-3.04/xpdf/XPDFViewer.cc:2409: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(buf, "%d%%", (int)z);
data/xpdf-3.04/xpdf/XPDFViewer.cc:2669: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 buf[20];
data/xpdf-3.04/xpdf/XPDFViewer.cc:2680:8:  [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).
  pg = atoi(s);
data/xpdf-3.04/xpdf/XPDFViewer.cc:2691: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(buf, "%d", viewer->core->getPageNum());
data/xpdf-3.04/xpdf/XPDFViewer.cc:2699: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 buf[20];
data/xpdf-3.04/xpdf/XPDFViewer.cc:2722:7:  [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(buf, "%d", pageNum);
data/xpdf-3.04/xpdf/XPDFViewer.cc:2739:7:  [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(buf, " of %d", numPages);
data/xpdf-3.04/xpdf/XPDFViewer.cc:2804: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 buf[8];
data/xpdf-3.04/xpdf/XPDFViewer.cc:2840: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).
    item->open();
data/xpdf-3.04/xpdf/XPDFViewer.cc:2874: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 buf[20];
data/xpdf-3.04/xpdf/XPDFViewer.cc:2967: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.
    s = XmStringCreateLocalized((char *)aboutWinText[i]);
data/xpdf-3.04/xpdf/XPDFViewer.cc:2970: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(buf, "t%d", i);
data/xpdf-3.04/xpdf/XPDFViewer.cc:3040:20:  [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).
      viewer->app->open(fileNameStr);
data/xpdf-3.04/xpdf/XPDFViewer.cc:3623: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 buf[20];
data/xpdf-3.04/xpdf/XPDFViewer.cc:3659: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(buf, "%d", doc->getNumPages());
data/xpdf-3.04/xpdf/XPDFViewer.cc:3729:15:  [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).
  firstPage = atoi(XmTextFieldGetString(viewer->printFirstPage));
data/xpdf-3.04/xpdf/XPDFViewer.cc:3730:14:  [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).
  lastPage = atoi(XmTextFieldGetString(viewer->printLastPage));
data/xpdf-3.04/xpdf/XPDFViewer.cc:3869:23:  [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 *searchText = (char *) args[0]->c_str();
data/xpdf-3.04/xpdf/XPDFViewer.h:67:8:  [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).
  void open(GString *fileName, int pageA, GString *destName);
data/xpdf-3.04/xpdf/XRef.cc:383: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 buf[xrefSearchSize+1];
data/xpdf-3.04/xpdf/XRef.cc:413: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 buf[100];
data/xpdf-3.04/xpdf/XRef.cc:473: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 buf[6];
data/xpdf-3.04/xpdf/XRef.cc:821: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 buf[256];
data/xpdf-3.04/xpdf/XRef.cc:874:13:  [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).
      num = atoi(p);
data/xpdf-3.04/xpdf/XRef.cc:884:12:  [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).
	    gen = atoi(p);
data/xpdf-3.04/xpdf/XRef.h:133: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 fileKey[32];		// file decryption key
data/xpdf-3.04/xpdf/Zoox.cc:27: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.
static char nameStartChar[256] = {
data/xpdf-3.04/xpdf/Zoox.cc:46: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.
static char nameChar[256] = {
data/xpdf-3.04/xpdf/Zoox.cc:177:13:  [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 (!(f = fopen(fileName, "rb"))) {
data/xpdf-3.04/xpdf/pdfdetach.cc:23: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.
static char savePath[1024] = "";
data/xpdf-3.04/xpdf/pdfdetach.cc:24: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.
static char textEncName[128] = "";
data/xpdf-3.04/xpdf/pdfdetach.cc:25: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.
static char ownerPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdfdetach.cc:26: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.
static char userPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdfdetach.cc:27: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.
static char cfgFileName[256] = "";
data/xpdf-3.04/xpdf/pdfdetach.cc:67: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 uBuf[8];
data/xpdf-3.04/xpdf/pdfdetach.cc:68: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 path[1024];
data/xpdf-3.04/xpdf/pdfdetach.cc:153: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(path, savePath, n);
data/xpdf-3.04/xpdf/pdfdetach.cc:166: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(p, uBuf, n);
data/xpdf-3.04/xpdf/pdfdetach.cc:194: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(p, uBuf, n);
data/xpdf-3.04/xpdf/pdffonts.cc:53: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.
static char ownerPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdffonts.cc:54: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.
static char userPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdffonts.cc:55: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.
static char cfgFileName[256] = "";
data/xpdf-3.04/xpdf/pdfimages.cc:33: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.
static char ownerPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdfimages.cc:34: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.
static char userPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdfimages.cc:36: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.
static char cfgFileName[256] = "";
data/xpdf-3.04/xpdf/pdfinfo.cc:45: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.
static char textEncName[128] = "";
data/xpdf-3.04/xpdf/pdfinfo.cc:46: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.
static char ownerPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdfinfo.cc:47: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.
static char userPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdfinfo.cc:48: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.
static char cfgFileName[256] = "";
data/xpdf-3.04/xpdf/pdfinfo.cc:92: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 buf[256];
data/xpdf-3.04/xpdf/pdfinfo.cc:252: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(buf, "Page %4d MediaBox: ", pg);
data/xpdf-3.04/xpdf/pdfinfo.cc:254: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(buf, "Page %4d CropBox:  ", pg);
data/xpdf-3.04/xpdf/pdfinfo.cc:256: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(buf, "Page %4d BleedBox: ", pg);
data/xpdf-3.04/xpdf/pdfinfo.cc:258: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(buf, "Page %4d TrimBox:  ", pg);
data/xpdf-3.04/xpdf/pdfinfo.cc:260: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(buf, "Page %4d ArtBox:   ", pg);
data/xpdf-3.04/xpdf/pdfinfo.cc:275:7:  [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).
  f = fopen(fileName->c_str(), "rb", "ctx=stm");
data/xpdf-3.04/xpdf/pdfinfo.cc:277:7:  [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).
  f = fopen(fileName->c_str(), "rb");
data/xpdf-3.04/xpdf/pdfinfo.cc:317: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 buf[8];
data/xpdf-3.04/xpdf/pdfinfo.cc:339: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 buf[256];
data/xpdf-3.04/xpdf/pdftohtml.cc:33: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.
static char ownerPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdftohtml.cc:34: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.
static char userPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdftohtml.cc:36: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.
static char cfgFileName[256] = "";
data/xpdf-3.04/xpdf/pdftohtml.cc:170:22:  [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 (!(htmlFile = fopen(htmlFileName->c_str(), "wb"))) {
data/xpdf-3.04/xpdf/pdftohtml.cc:176:21:  [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 (!(pngFile = fopen(pngFileName->c_str(), "wb"))) {
data/xpdf-3.04/xpdf/pdftohtml.cc:224: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).
  html = fopen(htmlFileName->c_str(), "w");
data/xpdf-3.04/xpdf/pdftopng.cc:29: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.
static char enableFreeTypeStr[16] = "";
data/xpdf-3.04/xpdf/pdftopng.cc:30: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.
static char antialiasStr[16] = "";
data/xpdf-3.04/xpdf/pdftopng.cc:31: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.
static char vectorAntialiasStr[16] = "";
data/xpdf-3.04/xpdf/pdftopng.cc:32: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.
static char ownerPassword[33] = "";
data/xpdf-3.04/xpdf/pdftopng.cc:33: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.
static char userPassword[33] = "";
data/xpdf-3.04/xpdf/pdftopng.cc:35: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.
static char cfgFileName[256] = "";
data/xpdf-3.04/xpdf/pdftopng.cc:190: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).
	if (!(f = fopen(pngFile->c_str(), "wb"))) {
data/xpdf-3.04/xpdf/pdftopng.cc:205: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).
	if (!(f = fopen(pngFile->c_str(), "wb"))) {
data/xpdf-3.04/xpdf/pdftopng.cc:220: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).
	if (!(f = fopen(pngFile->c_str(), "wb"))) {
data/xpdf-3.04/xpdf/pdftoppm.cc:35: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.
static char enableFreeTypeStr[16] = "";
data/xpdf-3.04/xpdf/pdftoppm.cc:36: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.
static char antialiasStr[16] = "";
data/xpdf-3.04/xpdf/pdftoppm.cc:37: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.
static char vectorAntialiasStr[16] = "";
data/xpdf-3.04/xpdf/pdftoppm.cc:38: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.
static char ownerPassword[33] = "";
data/xpdf-3.04/xpdf/pdftoppm.cc:39: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.
static char userPassword[33] = "";
data/xpdf-3.04/xpdf/pdftoppm.cc:41: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.
static char cfgFileName[256] = "";
data/xpdf-3.04/xpdf/pdftops.cc:52: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.
static char paperSize[15] = "";
data/xpdf-3.04/xpdf/pdftops.cc:61: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.
static char ownerPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdftops.cc:62: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.
static char userPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdftops.cc:64: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.
static char cfgFileName[256] = "";
data/xpdf-3.04/xpdf/pdftotext.cc:46: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.
static char textEncName[128] = "";
data/xpdf-3.04/xpdf/pdftotext.cc:47: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.
static char textEOL[16] = "";
data/xpdf-3.04/xpdf/pdftotext.cc:49: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.
static char ownerPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdftotext.cc:50: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.
static char userPassword[33] = "\001";
data/xpdf-3.04/xpdf/pdftotext.cc:52: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.
static char cfgFileName[256] = "";
data/xpdf-3.04/xpdf/xpdf.cc:25: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.
static char enableFreeTypeStr[16] = "";
data/xpdf-3.04/xpdf/xpdf.cc:26: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.
static char antialiasStr[16] = "";
data/xpdf-3.04/xpdf/xpdf.cc:27: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.
static char vectorAntialiasStr[16] = "";
data/xpdf-3.04/xpdf/xpdf.cc:28: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.
static char psFileArg[256];
data/xpdf-3.04/xpdf/xpdf.cc:29: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.
static char paperSize[15] = "";
data/xpdf-3.04/xpdf/xpdf.cc:33: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.
static char textEncName[128] = "";
data/xpdf-3.04/xpdf/xpdf.cc:34: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.
static char textEOL[16] = "";
data/xpdf-3.04/xpdf/xpdf.cc:35: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.
static char ownerPassword[33] = "\001";
data/xpdf-3.04/xpdf/xpdf.cc:36: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.
static char userPassword[33] = "\001";
data/xpdf-3.04/xpdf/xpdf.cc:38: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.
static char remoteName[100] = "xpdf_";
data/xpdf-3.04/xpdf/xpdf.cc:39: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.
static char remoteCmd[512] = "";
data/xpdf-3.04/xpdf/xpdf.cc:45: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.
static char cfgFileName[256] = "";
data/xpdf-3.04/xpdf/xpdf.cc:252:12:  [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).
      pg = atoi(argv[2]);
data/xpdf-3.04/xpdf/xpdf.cc:304: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 (!app->open(fileName, pg, ownerPasswordStr, userPasswordStr)) {
data/xpdf-3.04/goo/GString.cc:139:16:  [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).
  int n = (int)strlen(sA);
data/xpdf-3.04/goo/GString.cc:240:16:  [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).
  int n = (int)strlen(str);
data/xpdf-3.04/goo/GString.cc:334: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).
	  if (!strncmp(p0, formatStrings[ft], strlen(formatStrings[ft]))) {
data/xpdf-3.04/goo/GString.cc:341: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).
	p0 += strlen(formatStrings[ft]);
data/xpdf-3.04/goo/GString.cc:518: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).
	    len = (int)strlen(str);
data/xpdf-3.04/goo/GString.cc:711:16:  [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).
  int n = (int)strlen(str);
data/xpdf-3.04/goo/gfile.cc:416:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy(buf, p1, n);
data/xpdf-3.04/goo/gmem.cc:262: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).
  s1 = (char *)gmalloc((int)strlen(s) + 1);
data/xpdf-3.04/goo/parseargs.c:49:20:  [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 ((w1 = (int)strlen(arg->arg)) > w)
data/xpdf-3.04/goo/parseargs.c:60: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).
    w1 = 9 + w - (int)strlen(arg->arg);
data/xpdf-3.04/goo/parseargs.c:129:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy((char *)arg->val, argv[i+1], arg->size - 1);
data/xpdf-3.04/xpdf/AcroForm.cc:404: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).
    n = (int)strlen(s);
data/xpdf-3.04/xpdf/CMap.cc:42:10:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  return fgetc((FILE *)data);
data/xpdf-3.04/xpdf/CharCodeToUnicode.cc:52:10:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  return fgetc((FILE *)data);
data/xpdf-3.04/xpdf/CharCodeToUnicode.cc:170: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).
	!parseHex(tok, (int)strlen(tok), &u0)) {
data/xpdf-3.04/xpdf/CharCodeToUnicode.cc:181: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).
      if (!parseHex(tok, (int)strlen(tok), &uBuf[n])) {
data/xpdf-3.04/xpdf/GfxFont.cc:1139: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(charName) == 3 &&
data/xpdf-3.04/xpdf/GfxFont.cc:1146: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).
	    (strlen(charName) == 2 &&
data/xpdf-3.04/xpdf/GfxFont.cc:1176: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).
	n = (int)strlen(charName);
data/xpdf-3.04/xpdf/HTMLGen.cc:182: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).
  n = strlen(msg);
data/xpdf-3.04/xpdf/HTMLGen.cc:263: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).
  return writeFunc(stream, data, (int)strlen(data));
data/xpdf-3.04/xpdf/ImageOutputDev.cc:29:35:  [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).
  fileName = (char *)gmalloc((int)strlen(fileRoot) + 20);
data/xpdf-3.04/xpdf/PDFCore.cc:1024:4:  [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).
		 wcslen(history[historyCur].fileName)) != errNone) {
data/xpdf-3.04/xpdf/PDFCore.cc:1062:4:  [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).
		 wcslen(history[historyCur].fileName)) != errNone) {
data/xpdf-3.04/xpdf/PDFCore.cc:1751: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).
  len = (int)strlen(s);
data/xpdf-3.04/xpdf/PSOutputDev.cc:2199:12:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  buf[0] = fgetc(fontFile);
data/xpdf-3.04/xpdf/PSOutputDev.cc:2200:12:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  buf[1] = fgetc(fontFile);
data/xpdf-3.04/xpdf/PSOutputDev.cc:2204:11:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	buf[i] = fgetc(fontFile);
data/xpdf-3.04/xpdf/PSOutputDev.cc:2212:13:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	  if ((c = fgetc(fontFile)) == EOF) {
data/xpdf-3.04/xpdf/PSOutputDev.cc:2219:13:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	  if ((c = fgetc(fontFile)) == EOF) {
data/xpdf-3.04/xpdf/PSOutputDev.cc:2229:16:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      buf[0] = fgetc(fontFile);
data/xpdf-3.04/xpdf/PSOutputDev.cc:2230:16:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      buf[1] = fgetc(fontFile);
data/xpdf-3.04/xpdf/PSOutputDev.cc:2247:17:  [1] (buffer) fgetc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((c = fgetc(fontFile)) != EOF) {
data/xpdf-3.04/xpdf/PSOutputDev.cc:6914:41:  [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).
    (*outputFunc)(outputStream, s, (int)strlen(s));
data/xpdf-3.04/xpdf/UnicodeMap.cc:68:21:  [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).
      nBytes = (int)strlen(tok3) / 2;
data/xpdf-3.04/xpdf/XPDFApp.cc:345: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).
  n = strlen(cmd);
data/xpdf-3.04/xpdf/XPDFApp.cc:366:44:  [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).
		  PropModeReplace, (unsigned char *)cmd, strlen(cmd) + 1);
data/xpdf-3.04/xpdf/XPDFApp.cc:379:44:  [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).
		  PropModeReplace, (unsigned char *)cmd, strlen(cmd) + 1);
data/xpdf-3.04/xpdf/XPDFApp.cc:391:44:  [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).
		  PropModeReplace, (unsigned char *)cmd, strlen(cmd) + 1);
data/xpdf-3.04/xpdf/XPDFCore.cc:505: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).
    *length = strlen((char*) *value);
data/xpdf-3.04/xpdf/XPDFViewer.cc:885: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).
			    strlen(XmTextFieldGetString(pageNumText)),
data/xpdf-3.04/xpdf/Zoox.cc:732: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).
  n = (int)strlen(s);
data/xpdf-3.04/xpdf/pdfdetach.cc:149: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).
	n = (int)strlen(savePath);

ANALYSIS SUMMARY:

Hits = 532
Lines analyzed = 114662 in approximately 2.57 seconds (44616 lines/second)
Physical Source Lines of Code (SLOC) = 92923
Hits@level = [0] 192 [1]  43 [2] 469 [3]   6 [4]  14 [5]   0
Hits@level+ = [0+] 724 [1+] 532 [2+] 489 [3+]  20 [4+]  14 [5+]   0
Hits/KSLOC@level+ = [0+] 7.7914 [1+] 5.72517 [2+] 5.26242 [3+] 0.215232 [4+] 0.150662 [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.