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/optipng-0.7.7/src/cexcept/cexcept.h
Examining data/optipng-0.7.7/src/cexcept/example1.c
Examining data/optipng-0.7.7/src/cexcept/example2.c
Examining data/optipng-0.7.7/src/gifread/gifread.c
Examining data/optipng-0.7.7/src/gifread/gifread.h
Examining data/optipng-0.7.7/src/gifread/test/gifdump.c
Examining data/optipng-0.7.7/src/minitiff/minitiff.h
Examining data/optipng-0.7.7/src/minitiff/test/tiff2pnm.c
Examining data/optipng-0.7.7/src/minitiff/tiffread.c
Examining data/optipng-0.7.7/src/minitiff/tiffutil.c
Examining data/optipng-0.7.7/src/minitiff/tiffwrite.c
Examining data/optipng-0.7.7/src/opngreduc/opngreduc.c
Examining data/optipng-0.7.7/src/opngreduc/opngreduc.h
Examining data/optipng-0.7.7/src/optipng/bitset.c
Examining data/optipng-0.7.7/src/optipng/bitset.h
Examining data/optipng-0.7.7/src/optipng/ioutil.c
Examining data/optipng-0.7.7/src/optipng/ioutil.h
Examining data/optipng-0.7.7/src/optipng/optim.c
Examining data/optipng-0.7.7/src/optipng/optipng.c
Examining data/optipng-0.7.7/src/optipng/optipng.h
Examining data/optipng-0.7.7/src/optipng/proginfo.h
Examining data/optipng-0.7.7/src/optipng/ratio.c
Examining data/optipng-0.7.7/src/optipng/ratio.h
Examining data/optipng-0.7.7/src/optipng/test/bitset_test.c
Examining data/optipng-0.7.7/src/optipng/test/ratio_test.c
Examining data/optipng-0.7.7/src/optipng/wildargs.c
Examining data/optipng-0.7.7/src/pngxtern/pngxio.c
Examining data/optipng-0.7.7/src/pngxtern/pngxmem.c
Examining data/optipng-0.7.7/src/pngxtern/pngxpriv.h
Examining data/optipng-0.7.7/src/pngxtern/pngxrbmp.c
Examining data/optipng-0.7.7/src/pngxtern/pngxread.c
Examining data/optipng-0.7.7/src/pngxtern/pngxrgif.c
Examining data/optipng-0.7.7/src/pngxtern/pngxrjpg.c
Examining data/optipng-0.7.7/src/pngxtern/pngxrpnm.c
Examining data/optipng-0.7.7/src/pngxtern/pngxrtif.c
Examining data/optipng-0.7.7/src/pngxtern/pngxset.c
Examining data/optipng-0.7.7/src/pngxtern/pngxtern.h
Examining data/optipng-0.7.7/src/pngxtern/pngxutil.h
Examining data/optipng-0.7.7/src/pnmio/pnmin.c
Examining data/optipng-0.7.7/src/pnmio/pnmio.h
Examining data/optipng-0.7.7/src/pnmio/pnmout.c
Examining data/optipng-0.7.7/src/pnmio/pnmutil.c

FINAL RESULTS:

data/optipng-0.7.7/src/optipng/ioutil.c:520:9:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
    if (chown(dest_path, sbuf.st_uid, sbuf.st_gid) != 0)
data/optipng-0.7.7/src/optipng/ioutil.c:525:9:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    if (chmod(dest_path, sbuf.st_mode) != 0)
data/optipng-0.7.7/src/gifread/gifread.c:33:26:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define GIF_TRACE(args) (printf args)
data/optipng-0.7.7/src/optipng/ioutil.c:351:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(buffer, new_dirname);
data/optipng-0.7.7/src/optipng/ioutil.c:367: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(buffer + dirlen, path);
data/optipng-0.7.7/src/optipng/ioutil.c:421: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(buffer, path);
data/optipng-0.7.7/src/optipng/ioutil.c:422:5:  [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(buffer, bak_extname);
data/optipng-0.7.7/src/optipng/ioutil.c:458:13:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
        if (access(dest_path, OPNG_TEST_FILE) >= 0)
data/optipng-0.7.7/src/optipng/ioutil.c:598:9:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
        strcpy(wildname, dirname);
data/optipng-0.7.7/src/optipng/ioutil.c:691:16:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
        return access(path, faccess);
data/optipng-0.7.7/src/optipng/optim.c:1625:13:  [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(tmp_buf, outfile_name);
data/optipng-0.7.7/src/optipng/optipng.c:155:5:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vfprintf(stderr, fmt, arg_ptr);
data/optipng-0.7.7/src/optipng/optipng.c:785:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        vfprintf(con_file, fmt, arg_ptr);
data/optipng-0.7.7/src/optipng/optipng.c:791:9:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
        vfprintf(log_file, fmt, arg_ptr);
data/optipng-0.7.7/src/optipng/ratio.c:46:24:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#define OPNG_VSNPRINTF vsnprintf
data/optipng-0.7.7/src/pnmio/pnmout.c:107:17:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
            if (fprintf(stream,
data/optipng-0.7.7/src/cexcept/example2.c:34: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 barf[8];
data/optipng-0.7.7/src/cexcept/example2.c:68:5:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
    strcpy(e.info.barf, "ABCDEFG");
data/optipng-0.7.7/src/gifread/gifread.c:69:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char buffer[7];
data/optipng-0.7.7/src/gifread/gifread.c:169:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char    buffer[9];
data/optipng-0.7.7/src/gifread/gifread.c:320:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char buffer[256];
data/optipng-0.7.7/src/gifread/gifread.c:334:21:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static unsigned char buffer[280];
data/optipng-0.7.7/src/gifread/gifread.c:450: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.
            unsigned char buffer[260];
data/optipng-0.7.7/src/gifread/gifread.h:64:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char GlobalColorTable[GIF_NUMCOLORS_MAX * 3];
data/optipng-0.7.7/src/gifread/gifread.h:81:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char LocalColorTable[GIF_NUMCOLORS_MAX * 3];
data/optipng-0.7.7/src/gifread/test/gifdump.c:27:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    stream = fopen(filename, "rb");
data/optipng-0.7.7/src/minitiff/minitiff.h:246: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.
extern const char minitiff_sig_m[4];
data/optipng-0.7.7/src/minitiff/minitiff.h:247: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.
extern const char minitiff_sig_i[4];
data/optipng-0.7.7/src/minitiff/minitiff.h:248: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.
extern const char minitiff_sig_bigm[4];
data/optipng-0.7.7/src/minitiff/minitiff.h:249: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.
extern const char minitiff_sig_bigi[4];
data/optipng-0.7.7/src/minitiff/test/tiff2pnm.c:26: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).
    in_stream = fopen(in_path, "rb");
data/optipng-0.7.7/src/minitiff/test/tiff2pnm.c:59: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).
    out_stream = fopen(out_path, "wb");
data/optipng-0.7.7/src/minitiff/tiffread.c:154:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char buf[4];
data/optipng-0.7.7/src/minitiff/tiffread.c:202:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char buf[12];
data/optipng-0.7.7/src/minitiff/tiffutil.c:98: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 minitiff_sig_m[4] = { 0x4d, 0x4d, 0x00, 0x2a };  /* "MM\0*" */
data/optipng-0.7.7/src/minitiff/tiffutil.c:99: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 minitiff_sig_i[4] = { 0x49, 0x49, 0x2a, 0x00 };  /* "II*\0" */
data/optipng-0.7.7/src/minitiff/tiffutil.c:104: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 minitiff_sig_bigm[4] = { 0x4d, 0x4d, 0x00, 0x2b };  /* "MM\0*" */
data/optipng-0.7.7/src/minitiff/tiffutil.c:105: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 minitiff_sig_bigi[4] = { 0x49, 0x49, 0x2b, 0x00 };  /* "II*\0" */
data/optipng-0.7.7/src/opngreduc/opngreduc.c:217: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(buffer, palette, num_palette * sizeof(png_color));
data/optipng-0.7.7/src/opngreduc/opngreduc.c:243: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(buffer, trans_alpha, (size_t)num_trans);
data/optipng-0.7.7/src/optipng/ioutil.c:700: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).
            stream = fopen(path, "r+b");
data/optipng-0.7.7/src/optipng/ioutil.c:702: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).
            stream = fopen(path, "rb");
data/optipng-0.7.7/src/optipng/optim.c:223: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 buffer[32];
data/optipng-0.7.7/src/optipng/optim.c:420: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(chunk_name, chunk_type, 4);
data/optipng-0.7.7/src/optipng/optim.c:1517: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 name_buf[FILENAME_MAX], tmp_buf[FILENAME_MAX];
data/optipng-0.7.7/src/optipng/optim.c:1527: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(infile_name_local, "rb")) == NULL)
data/optipng-0.7.7/src/optipng/optim.c:1741: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).
    outfile = fopen(outfile_name, "wb");
data/optipng-0.7.7/src/optipng/optim.c:1756: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).
            infile = fopen(new_outfile ? infile_name_local : bakfile_name,
data/optipng-0.7.7/src/optipng/optipng.c:481: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 opt[16];
data/optipng-0.7.7/src/optipng/optipng.c:881:25:  [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 ((log_file = fopen(options.log_name, "a")) == NULL)
data/optipng-0.7.7/src/optipng/test/ratio_test.c:46: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 replica_buffer[BUFFER_SIZE];
data/optipng-0.7.7/src/optipng/test/ratio_test.c:84: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 check_buffer[BUFFER_SIZE];
data/optipng-0.7.7/src/optipng/test/ratio_test.c:119: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 buffer_factor[BUFFER_SIZE], buffer_percent[BUFFER_SIZE];
data/optipng-0.7.7/src/pngxtern/pngxio.c:106:10:  [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, crt_chunk_hdr + *crt_chunk_hdr_len_ptr, length);
data/optipng-0.7.7/src/pngxtern/pngxio.c:115:10:  [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(crt_chunk_hdr + *crt_chunk_hdr_len_ptr, data, length);
data/optipng-0.7.7/src/gifread/gifread.c:668:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if ((ch = getc(stream)) == EOF)
data/optipng-0.7.7/src/optipng/ioutil.c:344: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).
    dirlen = strlen(new_dirname);
data/optipng-0.7.7/src/optipng/ioutil.c:345: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).
    if (dirlen + strlen(path) + 2 >= bufsize)  /* overflow */
data/optipng-0.7.7/src/optipng/ioutil.c:412:9:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (strlen(path) + sizeof(bak_extname) > bufsize)
data/optipng-0.7.7/src/optipng/ioutil.c:590: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).
        dirlen = strlen(dirname);
data/optipng-0.7.7/src/optipng/optipng.c:227: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).
    len = strlen(str);
data/optipng-0.7.7/src/optipng/optipng.c:506:19:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        opt_len = strlen(opt);
data/optipng-0.7.7/src/optipng/optipng.c:780:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    start_of_line = (fmt[strlen(fmt) - 1] == '\n') ? 1 : 0;
data/optipng-0.7.7/src/optipng/test/ratio_test.c:54:27:  [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 (ullresult >= 0 && strlen(buffer) != (size_t)ullresult)
data/optipng-0.7.7/src/pngxtern/pngxrbmp.c:145:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      getc(stream);  /* skip padding */
data/optipng-0.7.7/src/pngxtern/pngxrbmp.c:162:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         ch = getc(stream);
data/optipng-0.7.7/src/pngxtern/pngxrbmp.c:175:7:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      getc(stream);  /* skip padding */
data/optipng-0.7.7/src/pngxtern/pngxrbmp.c:272:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         ch = getc(stream); b1 = (unsigned int)ch;
data/optipng-0.7.7/src/pngxtern/pngxrbmp.c:273:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         ch = getc(stream); b2 = (unsigned int)ch;
data/optipng-0.7.7/src/pngxtern/pngxrbmp.c:286:24:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                  ch = getc(stream);  /* check for the end of bitmap */
data/optipng-0.7.7/src/pngxtern/pngxrbmp.c:292:19:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                  getc(stream);  /* expect 1, but break the loop anyway */
data/optipng-0.7.7/src/pngxtern/pngxrbmp.c:307:21:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
               ch = getc(stream); b1 = (unsigned int)ch;  /* horiz. offset */
data/optipng-0.7.7/src/pngxtern/pngxrbmp.c:308:21:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
               ch = getc(stream); b2 = (unsigned int)ch;  /* vert. offset */
data/optipng-0.7.7/src/pngxtern/pngxrbmp.c:617:18:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if (ungetc(getc(stream), stream) == 0)  /* IHDR is likely to follow */
data/optipng-0.7.7/src/pngxtern/pngxread.c:107:11:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if (getc(stream) != EOF)
data/optipng-0.7.7/src/pngxtern/pngxrpnm.c:78:15:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
         ch = getc(stream);
data/optipng-0.7.7/src/pngxtern/pngxrpnm.c:82:21:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
               ch = getc(stream);
data/optipng-0.7.7/src/pngxtern/pngxrpnm.c:91:12:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      ch = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:41:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int ch = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:48:18:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            ch = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:55:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ch = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:101:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ch = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:127:10:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ch = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:133:10:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ch = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:219:18:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            ch = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:240:22:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                ch = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:250:23:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                ch8 = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:251:22:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                ch = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:264:28:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                    ch24 = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:265:24:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                ch16 = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:266:23:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                ch8 = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:267:22:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                ch = getc(stream);
data/optipng-0.7.7/src/pnmio/pnmin.c:346:18:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            ch = getc(stream);

ANALYSIS SUMMARY:

Hits = 93
Lines analyzed = 12733 in approximately 0.35 seconds (36729 lines/second)
Physical Source Lines of Code (SLOC) = 9009
Hits@level = [0]  97 [1]  38 [2]  39 [3]   0 [4]  14 [5]   2
Hits@level+ = [0+] 190 [1+]  93 [2+]  55 [3+]  16 [4+]  16 [5+]   2
Hits/KSLOC@level+ = [0+] 21.09 [1+] 10.323 [2+] 6.10501 [3+] 1.776 [4+] 1.776 [5+] 0.222
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.