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/paps-0.6.8/src/libpaps.c Examining data/paps-0.6.8/src/libpaps.h Examining data/paps-0.6.8/src/test_libpaps.c Examining data/paps-0.6.8/src/paps.c FINAL RESULTS: data/paps-0.6.8/src/libpaps.c:662: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(hash_string, "%08x-%d-%d", data/paps-0.6.8/src/paps.c:361:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). IN = fopen(filename_in, "rb"); data/paps-0.6.8/src/paps.c:387:56: [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). pango_font_description_set_size (font_description, atoi(DEFAULT_FONT_SIZE) * PANGO_SCALE); data/paps-0.6.8/src/paps.c:476:64: [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). pango_font_description_set_size (font_description, (int)(atoi(DEFAULT_FONT_SIZE) * PANGO_SCALE * scale)); data/paps-0.6.8/src/paps.c:538: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[BUFSIZE]; data/paps-0.6.8/src/paps.c:543: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 *ib, *ob, obuffer[BUFSIZE * 6], *bp = fgets (buffer, BUFSIZE-1, file); data/paps-0.6.8/src/paps.c:905: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. const char *bool_name[2] = { "false", "true" }; data/paps-0.6.8/src/paps.c:906: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. const char *orientation_names[2] = { "Portrait", "Landscape" }; data/paps-0.6.8/src/paps.c:558: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). iblen = strlen (ib); data/paps-0.6.8/src/paps.c:636:32: [1] (buffer) wcslen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). wnewtext = g_new (wchar_t, wcslen (wtext) + 1); data/paps-0.6.8/src/paps.c:721:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). para->length = strlen(text); ANALYSIS SUMMARY: Hits = 11 Lines analyzed = 2200 in approximately 0.11 seconds (19581 lines/second) Physical Source Lines of Code (SLOC) = 1681 Hits@level = [0] 29 [1] 3 [2] 8 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 40 [1+] 11 [2+] 8 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 23.7954 [1+] 6.54372 [2+] 4.75907 [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.