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/libgsf-1.14.47/gsf-win32/gsf-input-win32.c Examining data/libgsf-1.14.47/gsf-win32/gsf-output-win32.h Examining data/libgsf-1.14.47/gsf-win32/gsf-output-win32.c Examining data/libgsf-1.14.47/gsf-win32/gsf-input-win32.h Examining data/libgsf-1.14.47/gsf/gsf-output-iconv.h Examining data/libgsf-1.14.47/gsf/gsf-clip-data.c Examining data/libgsf-1.14.47/gsf/gsf-input-impl.h Examining data/libgsf-1.14.47/gsf/gsf-input-memory.h Examining data/libgsf-1.14.47/gsf/gsf-input-bzip.c Examining data/libgsf-1.14.47/gsf/gsf-utils.h Examining data/libgsf-1.14.47/gsf/gsf-structured-blob.h Examining data/libgsf-1.14.47/gsf/gsf-infile-stdio.h Examining data/libgsf-1.14.47/gsf/gsf-output.c Examining data/libgsf-1.14.47/gsf/gsf-msole-utils.c Examining data/libgsf-1.14.47/gsf/gsf-clip-data.h Examining data/libgsf-1.14.47/gsf/gsf-outfile.c Examining data/libgsf-1.14.47/gsf/gsf-input-textline.c Examining data/libgsf-1.14.47/gsf/gsf-input-bzip.h Examining data/libgsf-1.14.47/gsf/gsf-infile.h Examining data/libgsf-1.14.47/gsf/gsf-msole-utils.h Examining data/libgsf-1.14.47/gsf/gsf-libxml.c Examining data/libgsf-1.14.47/gsf/gsf-timestamp.h Examining data/libgsf-1.14.47/gsf/gsf-outfile-impl.h Examining data/libgsf-1.14.47/gsf/gsf-blob.c Examining data/libgsf-1.14.47/gsf/gsf-infile-tar.c Examining data/libgsf-1.14.47/gsf/gsf-output-iochannel.c Examining data/libgsf-1.14.47/gsf/gsf-output-gio.c Examining data/libgsf-1.14.47/gsf/gsf-zip-utils.c Examining data/libgsf-1.14.47/gsf/gsf-infile-stdio.c Examining data/libgsf-1.14.47/gsf/gsf-input-http.h Examining data/libgsf-1.14.47/gsf/gsf-outfile-zip.h Examining data/libgsf-1.14.47/gsf/gsf-input-http.c Examining data/libgsf-1.14.47/gsf/gsf-input-stdio.c Examining data/libgsf-1.14.47/gsf/gsf-input-gio.h Examining data/libgsf-1.14.47/gsf/gsf-input-proxy.c Examining data/libgsf-1.14.47/gsf/gsf-output-csv.c Examining data/libgsf-1.14.47/gsf/gsf-outfile-msole.h Examining data/libgsf-1.14.47/gsf/gsf-output-memory.c Examining data/libgsf-1.14.47/gsf/gsf-input.h Examining data/libgsf-1.14.47/gsf/gsf-priv.h Examining data/libgsf-1.14.47/gsf/gsf-opendoc-utils.c Examining data/libgsf-1.14.47/gsf/gsf-output-stdio.h Examining data/libgsf-1.14.47/gsf/gsf-infile-msole.h Examining data/libgsf-1.14.47/gsf/gsf-shared-memory.h Examining data/libgsf-1.14.47/gsf/gsf.h Examining data/libgsf-1.14.47/gsf/gsf-output-gio.h Examining data/libgsf-1.14.47/gsf/gsf-infile-impl.h Examining data/libgsf-1.14.47/gsf/gsf-outfile.h Examining data/libgsf-1.14.47/gsf/gsf-fwd.h Examining data/libgsf-1.14.47/gsf/gsf-output-bzip.c Examining data/libgsf-1.14.47/gsf/gsf-output-bzip.h Examining data/libgsf-1.14.47/gsf/gsf-outfile-msole.c Examining data/libgsf-1.14.47/gsf/gsf-input.c Examining data/libgsf-1.14.47/gsf/gsf-output.h Examining data/libgsf-1.14.47/gsf/gsf-infile-tar.h Examining data/libgsf-1.14.47/gsf/gsf-output-gzip.h Examining data/libgsf-1.14.47/gsf/gsf-infile-msvba.c Examining data/libgsf-1.14.47/gsf/gsf-outfile-stdio.h Examining data/libgsf-1.14.47/gsf/gsf-output-csv.h Examining data/libgsf-1.14.47/gsf/gsf-output-memory.h Examining data/libgsf-1.14.47/gsf/version.c Examining data/libgsf-1.14.47/gsf/gsf-shared-memory.c Examining data/libgsf-1.14.47/gsf/gsf-input-memory.c Examining data/libgsf-1.14.47/gsf/gsf-utils.c Examining data/libgsf-1.14.47/gsf/gsf-outfile-stdio.c Examining data/libgsf-1.14.47/gsf/gsf-infile-msvba.h Examining data/libgsf-1.14.47/gsf/gsf-output-iconv.c Examining data/libgsf-1.14.47/gsf/gsf-input-stdio.h Examining data/libgsf-1.14.47/gsf/gsf-output-iochannel.h Examining data/libgsf-1.14.47/gsf/gsf-input-gio.c Examining data/libgsf-1.14.47/gsf/gsf-zip-impl.h Examining data/libgsf-1.14.47/gsf/gsf-doc-meta-data.h Examining data/libgsf-1.14.47/gsf/gsf-docprop-vector.c Examining data/libgsf-1.14.47/gsf/gsf-opendoc-utils.h Examining data/libgsf-1.14.47/gsf/gsf-input-proxy.h Examining data/libgsf-1.14.47/gsf/gsf-open-pkg-utils.c Examining data/libgsf-1.14.47/gsf/gsf-doc-meta-data.c Examining data/libgsf-1.14.47/gsf/gsf-input-textline.h Examining data/libgsf-1.14.47/gsf/gsf-msole-impl.h Examining data/libgsf-1.14.47/gsf/gsf-docprop-vector.h Examining data/libgsf-1.14.47/gsf/gsf-input-iochannel.c Examining data/libgsf-1.14.47/gsf/gsf-libxml.h Examining data/libgsf-1.14.47/gsf/gsf-structured-blob.c Examining data/libgsf-1.14.47/gsf/gsf-output-impl.h Examining data/libgsf-1.14.47/gsf/gsf-output-gzip.c Examining data/libgsf-1.14.47/gsf/gsf-meta-names.h Examining data/libgsf-1.14.47/gsf/gsf-output-stdio.c Examining data/libgsf-1.14.47/gsf/gsf-impl-utils.h Examining data/libgsf-1.14.47/gsf/gsf-blob.h Examining data/libgsf-1.14.47/gsf/gsf-infile-msole.c Examining data/libgsf-1.14.47/gsf/gsf-outfile-zip.c Examining data/libgsf-1.14.47/gsf/gsf-infile-zip.c Examining data/libgsf-1.14.47/gsf/gsf-input-iochannel.h Examining data/libgsf-1.14.47/gsf/gsf-timestamp.c Examining data/libgsf-1.14.47/gsf/gsf-open-pkg-utils.h Examining data/libgsf-1.14.47/gsf/gsf-input-gzip.h Examining data/libgsf-1.14.47/gsf/gsf-infile-zip.h Examining data/libgsf-1.14.47/gsf/gsf-input-gzip.c Examining data/libgsf-1.14.47/gsf/gsf-infile.c Examining data/libgsf-1.14.47/gsf/gsf-priv.c Examining data/libgsf-1.14.47/thumbnailer/main.c Examining data/libgsf-1.14.47/tests/test-cat-zip.c Examining data/libgsf-1.14.47/tests/test-outmem-printf.c Examining data/libgsf-1.14.47/tests/test-ls-zip.c Examining data/libgsf-1.14.47/tests/test-zip1.c Examining data/libgsf-1.14.47/tests/test-zip-out-subdirs.c Examining data/libgsf-1.14.47/tests/test-msole1.c Examining data/libgsf-1.14.47/tests/test-msole-printf.c Examining data/libgsf-1.14.47/tests/test-gzip1.c Examining data/libgsf-1.14.47/tests/test-out-printf.c Examining data/libgsf-1.14.47/tests/test-zip-out.c Examining data/libgsf-1.14.47/tests/test-out-bzip.c Examining data/libgsf-1.14.47/tests/test-dump-msole.c Examining data/libgsf-1.14.47/tests/test-gio.c Examining data/libgsf-1.14.47/tests/test-zip2.c Examining data/libgsf-1.14.47/tests/test-msvba.c Examining data/libgsf-1.14.47/tests/test-xml.c Examining data/libgsf-1.14.47/tests/test-input1.c Examining data/libgsf-1.14.47/tests/test-cp-zip.c Examining data/libgsf-1.14.47/tests/test-msole-dup.c Examining data/libgsf-1.14.47/tests/test-restore-msole.c Examining data/libgsf-1.14.47/tests/test-msvba-zip.c Examining data/libgsf-1.14.47/tests/test-gzip2.c Examining data/libgsf-1.14.47/tests/test-cp-msole.c Examining data/libgsf-1.14.47/tests/test-cp.c Examining data/libgsf-1.14.47/tests/test-bzip.c Examining data/libgsf-1.14.47/tests/test-http.c Examining data/libgsf-1.14.47/tests/test-textline.c Examining data/libgsf-1.14.47/tests/test-msole2.c Examining data/libgsf-1.14.47/tests/test-out-gzip2.c Examining data/libgsf-1.14.47/tests/test-out-gzip1.c Examining data/libgsf-1.14.47/tools/gsf-vba-dump.c Examining data/libgsf-1.14.47/tools/gsf.c FINAL RESULTS: data/libgsf-1.14.47/gsf/gsf-output-stdio.c:118:9: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. return chown (filename, owner, group); data/libgsf-1.14.47/gsf/gsf-output-stdio.c:396: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. return vfprintf (((GsfOutputStdio *)output)->file, fmt, args); data/libgsf-1.14.47/gsf/gsf-blob.c:120: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, data_to_copy, size); data/libgsf-1.14.47/gsf/gsf-infile-msole.c:55:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char clsid[16]; /* 16 byte GUID used by some apps */ data/libgsf-1.14.47/gsf/gsf-infile-msole.c:712: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, ole->stream.buf + input->cur_offset, num_bytes); data/libgsf-1.14.47/gsf/gsf-infile-msole.c:1010: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 (res, ole->dirent->clsid, data/libgsf-1.14.47/gsf/gsf-infile-tar.c:60: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 name[100]; /* 0 */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:61: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 mode[8]; /* 100 (octal) */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:62: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 uid[8]; /* 108 (octal) */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:63: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 gid[8]; /* 116 (octal) */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:64: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 size[12]; /* 124 (octal) */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:65: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 mtime[12]; /* 136 (octal) */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:66: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 chksum[8]; /* 148 (octal) */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:68: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 linkname[100]; /* 157 */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:69: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 magic[6]; /* 257 */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:70: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 version[2]; /* 263 */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:71: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 uname[32]; /* 265 */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:72: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 gname[32]; /* 297 */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:73: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 devmajor[8]; /* 329 (octal) */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:74: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 devminor[8]; /* 337 (octal) */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:75: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 prefix[155]; /* 345 */ data/libgsf-1.14.47/gsf/gsf-infile-tar.c:76: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 filler[12]; /* 500 */ data/libgsf-1.14.47/gsf/gsf-infile-zip.c:311: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 (name, variable, name_len); data/libgsf-1.14.47/gsf/gsf-input-memory.c:94: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 (cpy, buf, length); data/libgsf-1.14.47/gsf/gsf-input-memory.c:132: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 (optional_buffer, src + input->cur_offset, num_bytes); data/libgsf-1.14.47/gsf/gsf-input-textline.c:220: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 (textline->buf + count, textline->remainder, len); data/libgsf-1.14.47/gsf/gsf-input.c:753: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. const unsigned char gzip_sig[2] = { 0x1f, 0x8b }; data/libgsf-1.14.47/gsf/gsf-libxml.c:1901: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;", *cur); data/libgsf-1.14.47/gsf/gsf-libxml.c:1959: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 buf [4 * sizeof (int)]; data/libgsf-1.14.47/gsf/gsf-libxml.c:1960: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, "%d", val); data/libgsf-1.14.47/gsf/gsf-libxml.c:1977: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 buf [4 * sizeof (unsigned int)]; data/libgsf-1.14.47/gsf/gsf-libxml.c:1978: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, "%u", val); data/libgsf-1.14.47/gsf/gsf-libxml.c:1997: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 buf[G_ASCII_DTOSTR_BUF_SIZE + DBL_DIG + 17]; data/libgsf-1.14.47/gsf/gsf-libxml.c:2002: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 format_str[4 * sizeof (int) + 10]; data/libgsf-1.14.47/gsf/gsf-libxml.c:2003: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 (format_str, "%%.%dg", precision); data/libgsf-1.14.47/gsf/gsf-libxml.c:2023: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 buf [3 * 4 * sizeof (unsigned int) + 1]; data/libgsf-1.14.47/gsf/gsf-libxml.c:2024: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, "%X:%X:%X", r, g, b); data/libgsf-1.14.47/gsf/gsf-libxml.c:2070: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 c[2] = { 0, 0 }; data/libgsf-1.14.47/gsf/gsf-libxml.c:2078: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 c[2] = { 0, 0 }; data/libgsf-1.14.47/gsf/gsf-msole-utils.c:2622: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 (res->name, sk->name, (sk->len + 1) * sizeof (gunichar2)); data/libgsf-1.14.47/gsf/gsf-outfile-msole.c:75:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char clsid[16]; /* 16 byte GUID used by some apps */ data/libgsf-1.14.47/gsf/gsf-outfile-msole.c:387: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 (buf + DIRENT_CLSID, child->clsid, sizeof (child->clsid)); data/libgsf-1.14.47/gsf/gsf-outfile-msole.c:393: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 (buf + DIRENT_CLSID, child->clsid, sizeof (child->clsid)); data/libgsf-1.14.47/gsf/gsf-outfile-msole.c:579: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 (ole->content.small_block.buf + output->cur_offset, data/libgsf-1.14.47/gsf/gsf-outfile-msole.c:888: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 (buf, default_header, sizeof (default_header)); data/libgsf-1.14.47/gsf/gsf-outfile-zip.c:191: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 tmp[8]; data/libgsf-1.14.47/gsf/gsf-outfile-zip.c:212: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 tmp[8]; data/libgsf-1.14.47/gsf/gsf-outfile-zip.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 tmp[4]; data/libgsf-1.14.47/gsf/gsf-outfile-zip.c:575: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 tmp[8]; data/libgsf-1.14.47/gsf/gsf-outfile-zip.c:594: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 tmp[4]; data/libgsf-1.14.47/gsf/gsf-output-gzip.c:98: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 (buf, gzip_signature, 3); data/libgsf-1.14.47/gsf/gsf-output-iconv.c:153: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 (ic->buf + ic->buf_len, data, count); data/libgsf-1.14.47/gsf/gsf-output-memory.c:127: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 (mem->buffer + output->cur_offset, buffer, num_bytes); data/libgsf-1.14.47/gsf/gsf-structured-blob.c:100: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 (optional_buffer, src + input->cur_offset, num_bytes); data/libgsf-1.14.47/gsf/gsf-utils.c:237: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. static const char hexdigit[16] = "0123456789abcdef"; data/libgsf-1.14.47/gsf/gsf-utils.c:240: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 hexpart[3 * 16 + 1], *phex = hexpart; data/libgsf-1.14.47/gsf/gsf-utils.c:241: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 pic[17]; data/libgsf-1.14.47/gsf/gsf-utils.c:424: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 (p, &f, sizeof (f)); data/libgsf-1.14.47/gsf/gsf-utils.c:446: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 ((char *)&data + 4, p, 4); data/libgsf-1.14.47/gsf/gsf-utils.c:447: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 ((char *)&data, (char const *)p + 4, 4); data/libgsf-1.14.47/gsf/gsf-utils.c:492: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, (char const *)&d + 4, 4); data/libgsf-1.14.47/gsf/gsf-utils.c:493: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 ((char *)p + 4, &d, 4); data/libgsf-1.14.47/gsf/gsf-utils.c:512: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 (p, &d, sizeof (d)); data/libgsf-1.14.47/gsf/gsf-zip-utils.c:59: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 (res, dirent, sizeof (GsfZipDirent)); data/libgsf-1.14.47/tests/test-msole1.c:44: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). FILE *file = fopen(fname, "r"); data/libgsf-1.14.47/tests/test-msole1.c:45:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buffer[1024]; data/libgsf-1.14.47/tests/test-msole1.c:49: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). file = fopen (newname, "r"); data/libgsf-1.14.47/tests/test-outmem-printf.c:58: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). fout = fopen (argv[1], "w"); data/libgsf-1.14.47/gsf/gsf-input.c:768:33: [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 (memcmp (bzip_sig, header, strlen (bzip_sig)) == 0) { data/libgsf-1.14.47/gsf/gsf-libxml.c:751: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). inst->taglen = strlen (inst->tag); data/libgsf-1.14.47/gsf/gsf-libxml.c:1846: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). gsf_output_write (xout->output, strlen (val_utf8), val_utf8); data/libgsf-1.14.47/gsf/gsf-libxml.c:1907: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). gsf_output_write (xout->output, strlen (buf), buf); data/libgsf-1.14.47/gsf/gsf-msole-utils.c:1422: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). len = strlen (txt); data/libgsf-1.14.47/gsf/gsf-msole-utils.c:2004: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). len = strlen (lang); data/libgsf-1.14.47/gsf/gsf-msole-utils.c:2581:13: [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). name_len = strlen (name); data/libgsf-1.14.47/gsf/gsf-outfile-zip.c:183:13: [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 nlen = strlen (dirent->name); data/libgsf-1.14.47/gsf/gsf-outfile-zip.c:475: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 (name) < G_MAXUINT16) { data/libgsf-1.14.47/gsf/gsf-outfile-zip.c:507: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). int nlen = strlen (name); data/libgsf-1.14.47/gsf/gsf-output-csv.c:100:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen (field); data/libgsf-1.14.47/gsf/gsf-output-csv.c:207: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). csv->eol_len = strlen (csv->eol); data/libgsf-1.14.47/gsf/gsf-output-csv.c:280:28: [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). csv->quote_len = scopy ? strlen (scopy) : 0; data/libgsf-1.14.47/gsf/gsf-output-csv.c:303: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). csv->eol_len = strlen (csv->eol); data/libgsf-1.14.47/gsf/gsf-output-csv.c:309:32: [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). csv->separator_len = scopy ? strlen (scopy) : 0; data/libgsf-1.14.47/gsf/gsf-output-stdio.c:506:16: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). saved_umask = umask (0077); data/libgsf-1.14.47/gsf/gsf-output-stdio.c:508:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask (saved_umask); data/libgsf-1.14.47/gsf/gsf-output.c:747:38: [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). reslen = output->printf_buf_size = strlen (output->printf_buf); data/libgsf-1.14.47/gsf/gsf-output.c:774: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). nbytes = strlen (line); data/libgsf-1.14.47/gsf/gsf-utils.c:539: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). end = path + strlen (path); data/libgsf-1.14.47/tests/test-zip-out-subdirs.c:35: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). return gsf_output_write (output, strlen (str), str); data/libgsf-1.14.47/tests/test-zip-out.c:35: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). return gsf_output_write (output, strlen (str), str); data/libgsf-1.14.47/tests/test-zip2.c:55: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 (res) + 1; ANALYSIS SUMMARY: Hits = 91 Lines analyzed = 31415 in approximately 0.99 seconds (31629 lines/second) Physical Source Lines of Code (SLOC) = 20240 Hits@level = [0] 63 [1] 23 [2] 66 [3] 0 [4] 1 [5] 1 Hits@level+ = [0+] 154 [1+] 91 [2+] 68 [3+] 2 [4+] 2 [5+] 1 Hits/KSLOC@level+ = [0+] 7.6087 [1+] 4.49605 [2+] 3.35968 [3+] 0.0988142 [4+] 0.0988142 [5+] 0.0494071 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.