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/libgxps-0.3.1/libgxps/gxps-archive.c Examining data/libgxps-0.3.1/libgxps/gxps-archive.h Examining data/libgxps-0.3.1/libgxps/gxps-brush.c Examining data/libgxps-0.3.1/libgxps/gxps-brush.h Examining data/libgxps-0.3.1/libgxps/gxps-color.c Examining data/libgxps-0.3.1/libgxps/gxps-color.h Examining data/libgxps-0.3.1/libgxps/gxps-core-properties.c Examining data/libgxps-0.3.1/libgxps/gxps-core-properties.h Examining data/libgxps-0.3.1/libgxps/gxps-debug.c Examining data/libgxps-0.3.1/libgxps/gxps-debug.h Examining data/libgxps-0.3.1/libgxps/gxps-document-structure.c Examining data/libgxps-0.3.1/libgxps/gxps-document-structure.h Examining data/libgxps-0.3.1/libgxps/gxps-document.c Examining data/libgxps-0.3.1/libgxps/gxps-document.h Examining data/libgxps-0.3.1/libgxps/gxps-error.c Examining data/libgxps-0.3.1/libgxps/gxps-error.h Examining data/libgxps-0.3.1/libgxps/gxps-file.c Examining data/libgxps-0.3.1/libgxps/gxps-file.h Examining data/libgxps-0.3.1/libgxps/gxps-fonts.c Examining data/libgxps-0.3.1/libgxps/gxps-fonts.h Examining data/libgxps-0.3.1/libgxps/gxps-glyphs.c Examining data/libgxps-0.3.1/libgxps/gxps-glyphs.h Examining data/libgxps-0.3.1/libgxps/gxps-images.c Examining data/libgxps-0.3.1/libgxps/gxps-images.h Examining data/libgxps-0.3.1/libgxps/gxps-links.c Examining data/libgxps-0.3.1/libgxps/gxps-links.h Examining data/libgxps-0.3.1/libgxps/gxps-matrix.c Examining data/libgxps-0.3.1/libgxps/gxps-matrix.h Examining data/libgxps-0.3.1/libgxps/gxps-page-private.h Examining data/libgxps-0.3.1/libgxps/gxps-page.c Examining data/libgxps-0.3.1/libgxps/gxps-page.h Examining data/libgxps-0.3.1/libgxps/gxps-parse-utils.c Examining data/libgxps-0.3.1/libgxps/gxps-parse-utils.h Examining data/libgxps-0.3.1/libgxps/gxps-path.c Examining data/libgxps-0.3.1/libgxps/gxps-path.h Examining data/libgxps-0.3.1/libgxps/gxps-private.h Examining data/libgxps-0.3.1/libgxps/gxps-resources.c Examining data/libgxps-0.3.1/libgxps/gxps-resources.h Examining data/libgxps-0.3.1/libgxps/gxps.h Examining data/libgxps-0.3.1/test/test-gxps.c Examining data/libgxps-0.3.1/tools/gxps-converter-main.c Examining data/libgxps-0.3.1/tools/gxps-converter.c Examining data/libgxps-0.3.1/tools/gxps-converter.h Examining data/libgxps-0.3.1/tools/gxps-image-converter.c Examining data/libgxps-0.3.1/tools/gxps-image-converter.h Examining data/libgxps-0.3.1/tools/gxps-image-writer.c Examining data/libgxps-0.3.1/tools/gxps-image-writer.h Examining data/libgxps-0.3.1/tools/gxps-jpeg-converter.c Examining data/libgxps-0.3.1/tools/gxps-jpeg-converter.h Examining data/libgxps-0.3.1/tools/gxps-jpeg-writer.c Examining data/libgxps-0.3.1/tools/gxps-jpeg-writer.h Examining data/libgxps-0.3.1/tools/gxps-pdf-converter.c Examining data/libgxps-0.3.1/tools/gxps-pdf-converter.h Examining data/libgxps-0.3.1/tools/gxps-png-converter.c Examining data/libgxps-0.3.1/tools/gxps-png-converter.h Examining data/libgxps-0.3.1/tools/gxps-png-writer.c Examining data/libgxps-0.3.1/tools/gxps-png-writer.h Examining data/libgxps-0.3.1/tools/gxps-print-converter.c Examining data/libgxps-0.3.1/tools/gxps-print-converter.h Examining data/libgxps-0.3.1/tools/gxps-ps-converter.c Examining data/libgxps-0.3.1/tools/gxps-ps-converter.h Examining data/libgxps-0.3.1/tools/gxps-svg-converter.c Examining data/libgxps-0.3.1/tools/gxps-svg-converter.h FINAL RESULTS: data/libgxps-0.3.1/libgxps/gxps-archive.c:441: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 + *bytes_read, buf, bytes); data/libgxps-0.3.1/libgxps/gxps-images.c:117: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 (base, &p, sizeof (uint32_t)); data/libgxps-0.3.1/libgxps/gxps-images.c:136: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 (base, &pixel, sizeof (uint32_t)); data/libgxps-0.3.1/libgxps/gxps-images.c:650: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, buffer->buffer + buffer->pos, size); data/libgxps-0.3.1/libgxps/gxps-parse-utils.c:108: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 (outbuf, inbuf, size); data/libgxps-0.3.1/test/test-gxps.c:79:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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[256]; data/libgxps-0.3.1/test/test-gxps.c:291:10: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). page = atoi (argv[2]); data/libgxps-0.3.1/tools/gxps-image-converter.c:120: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). fd = fopen (page_filename, "wb"); data/libgxps-0.3.1/tools/gxps-jpeg-writer.c:65:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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/libgxps-0.3.1/tools/gxps-png-writer.c:82:17: [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 (&pixel, b, sizeof (uint32_t)); data/libgxps-0.3.1/tools/gxps-png-writer.c:105:17: [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 (&pixel, b, sizeof (uint32_t)); data/libgxps-0.3.1/libgxps/gxps-archive.c:497:88: [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). const gchar *suffix = archive_entry_pathname (stream->entry) + strlen (prefix); data/libgxps-0.3.1/libgxps/gxps-brush.c:101: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). gsize len = strlen (color_str); data/libgxps-0.3.1/libgxps/gxps-brush.c:198:49: [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). icc_profile_uri = g_strndup (color_str, strlen (color_str) - strlen (p)); data/libgxps-0.3.1/libgxps/gxps-brush.c:198:70: [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). icc_profile_uri = g_strndup (color_str, strlen (color_str) - strlen (p)); data/libgxps-0.3.1/libgxps/gxps-brush.c:245:30: [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). p += strlen ("ContextColor"); data/libgxps-0.3.1/libgxps/gxps-fonts.c:150: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 (string) <= 35) { data/libgxps-0.3.1/libgxps/gxps-glyphs.c:255: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). token.end = token.iter + strlen (indices); data/libgxps-0.3.1/libgxps/gxps-links.c:242: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). target->uri = g_strndup (uri, strlen (uri) - strlen (sep)); data/libgxps-0.3.1/libgxps/gxps-links.c:242:48: [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). target->uri = g_strndup (uri, strlen (uri) - strlen (sep)); data/libgxps-0.3.1/libgxps/gxps-page.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). len = strlen ("{StaticResource "); data/libgxps-0.3.1/libgxps/gxps-page.c:487:57: [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). ret = g_markup_parse_context_parse (context, resource, strlen (resource), NULL) && data/libgxps-0.3.1/libgxps/gxps-parse-utils.c:434: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). memmove (start, start+i, strlen (start+i)+1); data/libgxps-0.3.1/libgxps/gxps-parse-utils.c:445: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). memmove (p, p+1, strlen (p+1)+1); data/libgxps-0.3.1/libgxps/gxps-parse-utils.c:456: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). memmove (p, q, strlen (q)+1); data/libgxps-0.3.1/libgxps/gxps-parse-utils.c:474: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). memmove (p, q, strlen (q)+1); data/libgxps-0.3.1/libgxps/gxps-parse-utils.c:496: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 (dirname) == 1 && dirname[0] == '.') data/libgxps-0.3.1/libgxps/gxps-path.c:268: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). token.end = token.iter + strlen (data); data/libgxps-0.3.1/tools/gxps-print-converter.c:114:45: [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 = g_strndup (basename, strlen (basename) - strlen (ext)); data/libgxps-0.3.1/tools/gxps-print-converter.c:114:65: [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 = g_strndup (basename, strlen (basename) - strlen (ext)); ANALYSIS SUMMARY: Hits = 30 Lines analyzed = 14863 in approximately 0.39 seconds (38446 lines/second) Physical Source Lines of Code (SLOC) = 10622 Hits@level = [0] 0 [1] 19 [2] 11 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 30 [1+] 30 [2+] 11 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 2.82433 [1+] 2.82433 [2+] 1.03559 [3+] 0 [4+] 0 [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.