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/x11-xfs-utils-7.7+2/xfsinfo/xfsinfo.c Examining data/x11-xfs-utils-7.7+2/fstobdf/header.c Examining data/x11-xfs-utils-7.7+2/fstobdf/chars.c Examining data/x11-xfs-utils-7.7+2/fstobdf/fstobdf.c Examining data/x11-xfs-utils-7.7+2/fstobdf/fstobdf.h Examining data/x11-xfs-utils-7.7+2/fstobdf/props.c Examining data/x11-xfs-utils-7.7+2/showfont/showfont.c Examining data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c FINAL RESULTS: data/x11-xfs-utils-7.7+2/fstobdf/chars.c:103:2: [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. fprintf(outFile, (fontHeader->char_range.min_char.low > 0 ? data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:98: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 msg[32]; data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:183:46: [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). max_output_line_width = (unsigned int) atoi(argv[0]); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:189:32: [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). columns = (unsigned int) atoi(argv[0]); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:243: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. FSFree((char *) fonts[i]); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:244: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. FSFree((char *) info[i]); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:245: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. FSFree((char *) props[i]); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:246: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. FSFree((char *) offsets[i]); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:247: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. FSFree((char *) pdata[i]); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:434: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 min[BUFSIZ], data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:439:2: [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(pmin, " min(l,r,w,a,d) = ("); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:440:2: [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(pmax, " max(l,r,w,a,d) = ("); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:481:5: [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(p1, "%d", n1); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:482:5: [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(p2, "%d", n2); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:484:5: [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(p1, "%*d", w, n1); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:485:5: [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(p2, "%*d", w, n2); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:496: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 buf[1000]; data/x11-xfs-utils-7.7+2/fstobdf/header.c:84:6: [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 pname[256]; data/x11-xfs-utils-7.7+2/fstobdf/props.c:53: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 new[256] = "\""; data/x11-xfs-utils-7.7+2/showfont/showfont.c:290: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 buf[512]; data/x11-xfs-utils-7.7+2/showfont/showfont.c:404:14: [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). scan_pad = atoi(argv[i]); data/x11-xfs-utils-7.7+2/showfont/showfont.c:409:15: [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). scan_unit = atoi(argv[i]); data/x11-xfs-utils-7.7+2/showfont/showfont.c:414:16: [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). bitmap_pad = atoi(argv[i]); data/x11-xfs-utils-7.7+2/showfont/showfont.c:419:14: [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). first_ch = atoi(argv[i]); data/x11-xfs-utils-7.7+2/showfont/showfont.c:424:12: [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). end_ch = atoi(argv[i]); data/x11-xfs-utils-7.7+2/showfont/showfont.c:436:6: [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 msg[128]; data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:339:29: [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). width = (unsigned int) strlen(font_list[i].name); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:441:10: [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). pmin += strlen(pmin); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:442:10: [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). pmax += strlen(pmax); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:483: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). w = (int) max(strlen(p1), strlen(p2)); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:483:31: [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). w = (int) max(strlen(p1), strlen(p2)); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:486: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). p1 += strlen(p1); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:487: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). p2 += strlen(p2); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:504:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, (char *) (pd + po->name.position), po->name.length); data/x11-xfs-utils-7.7+2/fslsfonts/fslsfonts.c:509:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, (char *)pd + po->value.position, po->value.length); data/x11-xfs-utils-7.7+2/fstobdf/header.c:79:29: [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). length = (unsigned int) strlen(propName); data/x11-xfs-utils-7.7+2/fstobdf/header.c:116:29: [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). length = (unsigned int) strlen(propName); data/x11-xfs-utils-7.7+2/showfont/showfont.c:295:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, (char *) (pd + po->name.position), po->name.length); data/x11-xfs-utils-7.7+2/showfont/showfont.c:300:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, (char *)(pd + po->value.position), po->value.length); ANALYSIS SUMMARY: Hits = 39 Lines analyzed = 1988 in approximately 0.08 seconds (25072 lines/second) Physical Source Lines of Code (SLOC) = 1420 Hits@level = [0] 129 [1] 13 [2] 25 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 168 [1+] 39 [2+] 26 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 118.31 [1+] 27.4648 [2+] 18.3099 [3+] 0.704225 [4+] 0.704225 [5+] 0 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.