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/pangox-compat-0.0.2/pangox-private.h Examining data/pangox-compat-0.0.2/pango-impl-utils.h Examining data/pangox-compat-0.0.2/pangox.c Examining data/pangox-compat-0.0.2/pangox-fontcache.c Examining data/pangox-compat-0.0.2/pangox-fontmap.c Examining data/pangox-compat-0.0.2/basic-x.c Examining data/pangox-compat-0.0.2/pangox.h FINAL RESULTS: data/pangox-compat-0.0.2/pangox.c:1038:4: [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 (result + strlen (xlfd) - 4, dash_charset); data/pangox-compat-0.0.2/pangox.c:1049:4: [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 (result + strlen (xlfd) - 2, dash_charset); data/pangox-compat-0.0.2/pangox.c:1059:4: [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 (result, xlfd); data/pangox-compat-0.0.2/pangox.c:1060:4: [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 (result + strlen (xlfd), dash_charset); data/pangox-compat-0.0.2/basic-x.c:60: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 charsets[MAX_CHARSETS]; data/pangox-compat-0.0.2/basic-x.c:215:13: [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 *charset_names[G_N_ELEMENTS(charsets)]; data/pangox-compat-0.0.2/basic-x.c:327: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 outbuf[4]; data/pangox-compat-0.0.2/basic-x.c:353: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 outbuf[2]; data/pangox-compat-0.0.2/basic-x.c:375: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 outbuf[2]; data/pangox-compat-0.0.2/basic-x.c:397: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 outbuf[4]; data/pangox-compat-0.0.2/basic-x.c:420: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 outbuf[4]; data/pangox-compat-0.0.2/basic-x.c:585: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 buf[6]; data/pangox-compat-0.0.2/basic-x.c:676: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 buf[6]; data/pangox-compat-0.0.2/pangox-fontmap.c:819: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). infile = fopen (filename, "r"); data/pangox-compat-0.0.2/pangox-fontmap.c:993: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 size_buffer[XLFD_MAX_FIELD_LEN]; data/pangox-compat-0.0.2/pangox-fontmap.c:999: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). size = atoi (size_buffer); data/pangox-compat-0.0.2/pangox-fontmap.c:1011:11: [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). if (atoi (size_buffer) == 0) data/pangox-compat-0.0.2/pangox-fontmap.c:1090: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(buffer, "(nil)"); data/pangox-compat-0.0.2/pangox-fontmap.c:1109: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 family_buffer[XLFD_MAX_FIELD_LEN]; data/pangox-compat-0.0.2/pangox-fontmap.c:1110: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 weight_buffer[XLFD_MAX_FIELD_LEN]; data/pangox-compat-0.0.2/pangox-fontmap.c:1111: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 slant_buffer[XLFD_MAX_FIELD_LEN]; data/pangox-compat-0.0.2/pangox-fontmap.c:1112: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 set_width_buffer[XLFD_MAX_FIELD_LEN]; data/pangox-compat-0.0.2/pangox-fontmap.c:1083:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (buffer, t1, len); data/pangox-compat-0.0.2/pangox-fontmap.c:1157:5: [1] (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 character. strcpy (slant_buffer, "*"); data/pangox-compat-0.0.2/pangox-fontmap.c:1174:5: [1] (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 character. strcpy (weight_buffer, "*"); data/pangox-compat-0.0.2/pangox-fontmap.c:1189:5: [1] (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 character. strcpy (set_width_buffer, "*"); data/pangox-compat-0.0.2/pangox-fontmap.c:1238: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). size_t len_a = strlen (a); data/pangox-compat-0.0.2/pangox-fontmap.c:1239: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). size_t len_b = strlen (b); data/pangox-compat-0.0.2/pangox.c:1007: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). size_t len_a = strlen (a); data/pangox-compat-0.0.2/pangox.c:1008: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). size_t len_b = strlen (b); data/pangox-compat-0.0.2/pangox.c:1036:23: [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). result = g_malloc (strlen (xlfd) - 4 + strlen (dash_charset) + 1); data/pangox-compat-0.0.2/pangox.c:1036:43: [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). result = g_malloc (strlen (xlfd) - 4 + strlen (dash_charset) + 1); data/pangox-compat-0.0.2/pangox.c:1037:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (result, xlfd, strlen (xlfd) - 4); data/pangox-compat-0.0.2/pangox.c:1037: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). strncpy (result, xlfd, strlen (xlfd) - 4); data/pangox-compat-0.0.2/pangox.c:1038: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). strcpy (result + strlen (xlfd) - 4, dash_charset); data/pangox-compat-0.0.2/pangox.c:1047:23: [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). result = g_malloc (strlen (xlfd) - 2 + strlen (dash_charset) + 1); data/pangox-compat-0.0.2/pangox.c:1047:43: [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). result = g_malloc (strlen (xlfd) - 2 + strlen (dash_charset) + 1); data/pangox-compat-0.0.2/pangox.c:1048:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy (result, xlfd, strlen (xlfd) - 2); data/pangox-compat-0.0.2/pangox.c:1048: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). strncpy (result, xlfd, strlen (xlfd) - 2); data/pangox-compat-0.0.2/pangox.c:1049: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). strcpy (result + strlen (xlfd) - 2, dash_charset); data/pangox-compat-0.0.2/pangox.c:1058:23: [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). result = g_malloc (strlen (xlfd) + strlen (dash_charset) + 1); data/pangox-compat-0.0.2/pangox.c:1058: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). result = g_malloc (strlen (xlfd) + strlen (dash_charset) + 1); data/pangox-compat-0.0.2/pangox.c:1060: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). strcpy (result + strlen (xlfd), dash_charset); ANALYSIS SUMMARY: Hits = 43 Lines analyzed = 4927 in approximately 0.14 seconds (35564 lines/second) Physical Source Lines of Code (SLOC) = 3450 Hits@level = [0] 0 [1] 21 [2] 18 [3] 0 [4] 4 [5] 0 Hits@level+ = [0+] 43 [1+] 43 [2+] 22 [3+] 4 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 12.4638 [1+] 12.4638 [2+] 6.37681 [3+] 1.15942 [4+] 1.15942 [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.