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/libjpeg9-9d/wrppm.c
Examining data/libjpeg9-9d/wrrle.c
Examining data/libjpeg9-9d/jdinput.c
Examining data/libjpeg9-9d/rdjpgcom.c
Examining data/libjpeg9-9d/jccoefct.c
Examining data/libjpeg9-9d/jcmainct.c
Examining data/libjpeg9-9d/example.c
Examining data/libjpeg9-9d/jcapimin.c
Examining data/libjpeg9-9d/jcapistd.c
Examining data/libjpeg9-9d/jctrans.c
Examining data/libjpeg9-9d/rdbmp.c
Examining data/libjpeg9-9d/rdgif.c
Examining data/libjpeg9-9d/transupp.c
Examining data/libjpeg9-9d/transupp.h
Examining data/libjpeg9-9d/jdatadst.c
Examining data/libjpeg9-9d/rdppm.c
Examining data/libjpeg9-9d/rdrle.c
Examining data/libjpeg9-9d/jcdctmgr.c
Examining data/libjpeg9-9d/rdtarga.c
Examining data/libjpeg9-9d/jdatasrc.c
Examining data/libjpeg9-9d/djpeg.c
Examining data/libjpeg9-9d/jcmarker.c
Examining data/libjpeg9-9d/jdcolor.c
Examining data/libjpeg9-9d/jcmaster.c
Examining data/libjpeg9-9d/jdhuff.c
Examining data/libjpeg9-9d/jcomapi.c
Examining data/libjpeg9-9d/jerror.c
Examining data/libjpeg9-9d/jerror.h
Examining data/libjpeg9-9d/jcparam.c
Examining data/libjpeg9-9d/jcarith.c
Examining data/libjpeg9-9d/wrjpgcom.c
Examining data/libjpeg9-9d/jdsample.c
Examining data/libjpeg9-9d/jcprepct.c
Examining data/libjpeg9-9d/jinclude.h
Examining data/libjpeg9-9d/wrtarga.c
Examining data/libjpeg9-9d/cjpeg.c
Examining data/libjpeg9-9d/jchuff.c
Examining data/libjpeg9-9d/jquant1.c
Examining data/libjpeg9-9d/jquant2.c
Examining data/libjpeg9-9d/jaricom.c
Examining data/libjpeg9-9d/jdmerge.c
Examining data/libjpeg9-9d/jidctflt.c
Examining data/libjpeg9-9d/jidctfst.c
Examining data/libjpeg9-9d/jidctint.c
Examining data/libjpeg9-9d/cderror.h
Examining data/libjpeg9-9d/jdct.h
Examining data/libjpeg9-9d/jccolor.c
Examining data/libjpeg9-9d/rdswitch.c
Examining data/libjpeg9-9d/jmemansi.c
Examining data/libjpeg9-9d/jdcoefct.c
Examining data/libjpeg9-9d/jdmainct.c
Examining data/libjpeg9-9d/jpegint.h
Examining data/libjpeg9-9d/jpeglib.h
Examining data/libjpeg9-9d/jutils.c
Examining data/libjpeg9-9d/jdapimin.c
Examining data/libjpeg9-9d/jdapistd.c
Examining data/libjpeg9-9d/jdtrans.c
Examining data/libjpeg9-9d/jddctmgr.c
Examining data/libjpeg9-9d/jdpostct.c
Examining data/libjpeg9-9d/jdmarker.c
Examining data/libjpeg9-9d/jmemname.c
Examining data/libjpeg9-9d/jdmaster.c
Examining data/libjpeg9-9d/jmemnobs.c
Examining data/libjpeg9-9d/jversion.h
Examining data/libjpeg9-9d/jpegtran.c
Examining data/libjpeg9-9d/rdcolmap.c
Examining data/libjpeg9-9d/jcsample.c
Examining data/libjpeg9-9d/jmemdos.c
Examining data/libjpeg9-9d/jfdctflt.c
Examining data/libjpeg9-9d/jfdctfst.c
Examining data/libjpeg9-9d/jmemmac.c
Examining data/libjpeg9-9d/jmemmgr.c
Examining data/libjpeg9-9d/jfdctint.c
Examining data/libjpeg9-9d/jmemsys.h
Examining data/libjpeg9-9d/cdjpeg.c
Examining data/libjpeg9-9d/cdjpeg.h
Examining data/libjpeg9-9d/jcinit.c
Examining data/libjpeg9-9d/jdarith.c
Examining data/libjpeg9-9d/ckconfig.c
Examining data/libjpeg9-9d/wrbmp.c
Examining data/libjpeg9-9d/wrgif.c
Examining data/libjpeg9-9d/debian/extra/jpegexiforient.c
Examining data/libjpeg9-9d/jmorecfg.h

FINAL RESULTS:

data/libjpeg9-9d/jerror.c:194:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(buffer, msgtext, err->msg_parm.s);
data/libjpeg9-9d/jerror.c:196:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(buffer, msgtext,
data/libjpeg9-9d/jmemmac.c:240:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(info->temp_name, TEMP_FILE_NAME, next_file_num);
data/libjpeg9-9d/jmemmac.c:241:5:  [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 ( (Ptr)fName+1, info->temp_name );
data/libjpeg9-9d/jmemname.c:102:5:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
    sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);
data/libjpeg9-9d/jmemname.c:129:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
  sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);
data/libjpeg9-9d/jmemname.c:130:3:  [4] (tmpfile) mktemp:
  Temporary file race condition (CWE-377).
  mktemp(fname);		/* make sure file name is unique */
data/libjpeg9-9d/wrjpgcom.c:462:2:  [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(comment_arg, argv[argn]+1);
data/libjpeg9-9d/wrjpgcom.c:478:4:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
	  strcat(comment_arg, argv[argn]);
data/libjpeg9-9d/jmemdos.c:50:15:  [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.
extern char * getenv JPP((const char * name));
data/libjpeg9-9d/jmemdos.c:139:31:  [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 ((env = (const char *) getenv("TMP")) == NULL)
data/libjpeg9-9d/jmemdos.c:140:33:  [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 ((env = (const char *) getenv("TEMP")) == NULL)
data/libjpeg9-9d/jmemmgr.c:36:15:  [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.
extern char * getenv JPP((const char * name));
data/libjpeg9-9d/jmemmgr.c:1103:19:  [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 ((memenv = getenv("JPEGMEM")) != NULL) {
data/libjpeg9-9d/cjpeg.c:597:23:  [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 ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {
data/libjpeg9-9d/cjpeg.c:608:24:  [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 ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {
data/libjpeg9-9d/ckconfig.c:297: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 ((outfile = fopen("jconfig.h", "w")) == NULL) {
data/libjpeg9-9d/debian/extra/jpegexiforient.c:43: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 exif_data[65536L];
data/libjpeg9-9d/debian/extra/jpegexiforient.c:145:19:  [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 ((myfile = fopen(argv[i], "rb+")) == NULL) {
data/libjpeg9-9d/debian/extra/jpegexiforient.c:150:19:  [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 ((myfile = fopen(argv[i], "rb")) == NULL) {
data/libjpeg9-9d/djpeg.c:287:17:  [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 ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) {
data/libjpeg9-9d/djpeg.c:517:23:  [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 ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {
data/libjpeg9-9d/djpeg.c:528:24:  [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 ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {
data/libjpeg9-9d/example.c:114: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 ((outfile = fopen(filename, "wb")) == NULL) {
data/libjpeg9-9d/example.c:306:17:  [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 ((infile = fopen(filename, "rb")) == NULL) {
data/libjpeg9-9d/jcarith.c:41:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char * dc_stats[NUM_ARITH_TBLS];
data/libjpeg9-9d/jcarith.c:42: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 * ac_stats[NUM_ARITH_TBLS];
data/libjpeg9-9d/jcarith.c: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 fixed_bin[4];
data/libjpeg9-9d/jchuff.c:44: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 ehufsi[256];		/* length of code for each symbol */
data/libjpeg9-9d/jchuff.c:167: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 huffsize[257];
data/libjpeg9-9d/jcmarker.c:231: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 dc_in_use[NUM_ARITH_TBLS];
data/libjpeg9-9d/jcmarker.c:232: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 ac_in_use[NUM_ARITH_TBLS];
data/libjpeg9-9d/jdarith.c:38: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 * dc_stats[NUM_ARITH_TBLS];
data/libjpeg9-9d/jdarith.c:39: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 * ac_stats[NUM_ARITH_TBLS];
data/libjpeg9-9d/jdarith.c:42: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 fixed_bin[4];
data/libjpeg9-9d/jdhuff.c:330: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 huffsize[257];
data/libjpeg9-9d/jerror.c:101: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 buffer[JMSG_LENGTH_MAX];
data/libjpeg9-9d/jinclude.h:63:32:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define MEMCOPY(dest,src,size)	bcopy((const void *)(src), (void *)(dest), (size_t)(size))
data/libjpeg9-9d/jinclude.h:69:32:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
#define MEMCOPY(dest,src,size)	memcpy((void *)(dest), (const void *)(src), (size_t)(size))
data/libjpeg9-9d/jmemansi.c:144:26:  [2] (tmpfile) tmpfile:
  Function tmpfile() has a security flaw on some systems (e.g., older System
  V systems) (CWE-377).
  if ((info->temp_file = tmpfile()) == NULL)
data/libjpeg9-9d/jmemdos.c:151: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(ptr, "JPG%03d.TMP", next_file_num);
data/libjpeg9-9d/jmemdos.c:153: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 ((tfile = fopen(fname, READ_BINARY)) == NULL)
data/libjpeg9-9d/jmemdos.c: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 endbuffer[2];
data/libjpeg9-9d/jmemdos.c:360: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.
    ((char FAR *) buffer_address)[byte_count - 1L] = endbuffer[0];
data/libjpeg9-9d/jmemdos.c:372: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 endbuffer[2];
data/libjpeg9-9d/jmemdos.c:393:22:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    endbuffer[0] = ((char FAR *) buffer_address)[byte_count - 1L];
data/libjpeg9-9d/jmemdos.c:468:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char bytes[18];		/* Misaligned fields in here! */
data/libjpeg9-9d/jmemname.c:103: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 ((tfile = fopen(fname, READ_BINARY)) == NULL) {
data/libjpeg9-9d/jmemname.c:251:26:  [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 ((info->temp_file = fopen(info->temp_name, RW_BINARY)) == NULL)
data/libjpeg9-9d/jmemsys.h:156: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 temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */
data/libjpeg9-9d/jmemsys.h:162: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 temp_name[TEMP_NAME_LENGTH]; /* name if it's a file */
data/libjpeg9-9d/jmemsys.h:166: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 temp_name[TEMP_NAME_LENGTH]; /* name of temp file */
data/libjpeg9-9d/jpeglib.h:722: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 s[JMSG_STR_PARM_MAX];
data/libjpeg9-9d/jpegtran.c:492: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 ((fp = fopen(argv[file_index], READ_BINARY)) == NULL) {
data/libjpeg9-9d/jpegtran.c:504: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 ((drop_file = fopen(dropfilename, READ_BINARY)) == NULL) {
data/libjpeg9-9d/jpegtran.c:593: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 ((fp = fopen(outfilename, WRITE_BINARY)) == NULL) {
data/libjpeg9-9d/rdjpgcom.c:490:19:  [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 ((infile = fopen(argv[argn], READ_BINARY)) == NULL) {
data/libjpeg9-9d/rdswitch.c:91: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 ((fp = fopen(filename, "r")) == NULL) {
data/libjpeg9-9d/rdswitch.c:184: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 ((fp = fopen(filename, "r")) == NULL) {
data/libjpeg9-9d/wrbmp.c:155: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 bmpfileheader[14];
data/libjpeg9-9d/wrbmp.c:156: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 bmpinfoheader[40];
data/libjpeg9-9d/wrbmp.c:228: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 bmpfileheader[14];
data/libjpeg9-9d/wrbmp.c:229: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 bmpcoreheader[12];
data/libjpeg9-9d/wrgif.c:99: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 packetbuf[256];		/* workspace for accumulating packet */
data/libjpeg9-9d/wrjpgcom.c:443: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 ((comment_file = fopen(argv[argn], "r")) == NULL) {
data/libjpeg9-9d/wrjpgcom.c:501:19:  [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 ((infile = fopen(argv[argn], READ_BINARY)) == NULL) {
data/libjpeg9-9d/wrjpgcom.c:528: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 ((outfile = fopen(argv[argn+1], WRITE_BINARY)) == NULL) {
data/libjpeg9-9d/wrrle.c:181: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 cmapcomment[80];
data/libjpeg9-9d/wrrle.c:205: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(cmapcomment, "color_map_length=%d", cinfo->actual_number_of_colors);
data/libjpeg9-9d/wrtarga.c:58: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 targaheader[18];
data/libjpeg9-9d/cjpeg.c:93:12:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if ((c = getc(infile)) == EOF)
data/libjpeg9-9d/debian/extra/jpegexiforient.c:46:21:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
#define NEXTBYTE()  getc(myfile)
data/libjpeg9-9d/jerror.h:245:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
data/libjpeg9-9d/jerror.h:301:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
   strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \
data/libjpeg9-9d/jmemmac.c:242: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).
    *fName = strlen (info->temp_name);
data/libjpeg9-9d/rdbmp.c:75:12:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if ((c = getc(infile)) == EOF)
data/libjpeg9-9d/rdbmp.c:233:16:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if ((c = getc(infile)) == EOF)
data/libjpeg9-9d/rdcolmap.c:88:22:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((header[i] = getc(infile)) == EOF)
data/libjpeg9-9d/rdcolmap.c:104:9:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    R = getc(infile);
data/libjpeg9-9d/rdcolmap.c:105:9:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    G = getc(infile);
data/libjpeg9-9d/rdcolmap.c:106:9:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    B = getc(infile);
data/libjpeg9-9d/rdcolmap.c:127:8:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ch = getc(infile);
data/libjpeg9-9d/rdcolmap.c:130:12:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      ch = getc(infile);
data/libjpeg9-9d/rdcolmap.c:178:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  c = getc(infile);		/* save format discriminator for a sec */
data/libjpeg9-9d/rdcolmap.c:207:6:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	R = getc(infile);
data/libjpeg9-9d/rdcolmap.c:208:6:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	G = getc(infile);
data/libjpeg9-9d/rdcolmap.c:209:6:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	B = getc(infile);
data/libjpeg9-9d/rdcolmap.c:240:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  switch (getc(infile)) {
data/libjpeg9-9d/rdgif.c:154:12:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if ((c = getc(infile)) == EOF)
data/libjpeg9-9d/rdjpgcom.c:68:21:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
#define NEXTBYTE()  getc(infile)
data/libjpeg9-9d/rdppm.c:90:8:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ch = getc(infile);
data/libjpeg9-9d/rdppm.c:93:12:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      ch = getc(infile);
data/libjpeg9-9d/rdppm.c:345:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (getc(source->pub.input_file) != 'P')
data/libjpeg9-9d/rdppm.c:348:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  c = getc(source->pub.input_file); /* subformat discriminator character */
data/libjpeg9-9d/rdswitch.c:29:8:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ch = getc(file);
data/libjpeg9-9d/rdswitch.c:32:12:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      ch = getc(file);
data/libjpeg9-9d/rdtarga.c:95:12:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if ((c = getc(infile)) == EOF)
data/libjpeg9-9d/wrjpgcom.c:79:21:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
#define NEXTBYTE()  getc(infile)
data/libjpeg9-9d/wrjpgcom.c:457:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(argv[argn]+1) >= (size_t) MAX_COM_LENGTH) {
data/libjpeg9-9d/wrjpgcom.c:464:36:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	  comment_length = (unsigned int) strlen(comment_arg);
data/libjpeg9-9d/wrjpgcom.c:471:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	  if (strlen(comment_arg) + 1 + strlen(argv[argn]) >=
data/libjpeg9-9d/wrjpgcom.c:471:34:  [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(comment_arg) + 1 + strlen(argv[argn]) >=
data/libjpeg9-9d/wrjpgcom.c:477:4:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
	  strcat(comment_arg, " ");
data/libjpeg9-9d/wrjpgcom.c:480:18:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      } else if (strlen(comment_arg) >= (size_t) MAX_COM_LENGTH) {
data/libjpeg9-9d/wrjpgcom.c:485: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).
      comment_length = (unsigned int) strlen(comment_arg);
data/libjpeg9-9d/wrjpgcom.c:562:17:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while ((c = getc(src_file)) != EOF) {

ANALYSIS SUMMARY:

Hits = 106
Lines analyzed = 49979 in approximately 1.53 seconds (32750 lines/second)
Physical Source Lines of Code (SLOC) = 30877
Hits@level = [0] 287 [1]  36 [2]  56 [3]   5 [4]   9 [5]   0
Hits@level+ = [0+] 393 [1+] 106 [2+]  70 [3+]  14 [4+]   9 [5+]   0
Hits/KSLOC@level+ = [0+] 12.7279 [1+] 3.43298 [2+] 2.26706 [3+] 0.453412 [4+] 0.291479 [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.