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/par-1.52/buffer.c Examining data/par-1.52/buffer.h Examining data/par-1.52/charset.c Examining data/par-1.52/charset.h Examining data/par-1.52/errmsg.c Examining data/par-1.52/errmsg.h Examining data/par-1.52/reformat.c Examining data/par-1.52/reformat.h Examining data/par-1.52/par.c FINAL RESULTS: data/par-1.52/buffer.c:63:5: [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(errmsg,outofmem); data/par-1.52/buffer.c:130:9: [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(errmsg,outofmem); data/par-1.52/buffer.c:177:5: [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(errmsg,outofmem); data/par-1.52/charset.c:100:5: [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(errmsg,outofmem); data/par-1.52/charset.c:198:5: [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(errmsg,outofmem); data/par-1.52/par.c:364:17: [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(errmsg,outofmem); data/par-1.52/par.c:732:7: [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(errmsg,outofmem); data/par-1.52/par.c:735:5: [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(parinit,env); data/par-1.52/par.c:836:15: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(errmsg,impossibility,5); data/par-1.52/reformat.c:171:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(errmsg,impossibility,1); data/par-1.52/reformat.c:205:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(errmsg,impossibility,2); data/par-1.52/reformat.c:291:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(errmsg,impossibility,3); data/par-1.52/reformat.c:315:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(errmsg,impossibility,4); data/par-1.52/reformat.c:324:5: [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(errmsg,outofmem); data/par-1.52/reformat.c:356:9: [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(errmsg,outofmem); data/par-1.52/reformat.c:413:11: [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(errmsg,outofmem); data/par-1.52/reformat.c:472:7: [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(errmsg,outofmem); data/par-1.52/par.c:704:9: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env = getenv("PARBODY"); data/par-1.52/par.c:712:9: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env = getenv("PARPROTECT"); data/par-1.52/par.c:720:9: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env = getenv("PARQUOTE"); data/par-1.52/par.c:728:9: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. env = getenv("PARINIT"); data/par-1.52/buffer.c:143: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( ((char *) blk->items) + (blk->numhere * itemsize), item, itemsize ); data/par-1.52/buffer.c:184:5: [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 *) r) + (blk->numprevious * itemsize), data/par-1.52/charset.c:156: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(errmsg, "Bad charset syntax: %.*s\n", errmsg_size - 22, str); data/par-1.52/charset.c:194: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 *lists[4], **list, *p, nullchar = '\0'; data/par-1.52/errmsg.h:23: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. typedef char errmsg_t[errmsg_size]; data/par-1.52/par.c:281: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(errmsg, "Bad argument: %.*s\n", errmsg_size - 16, savearg); data/par-1.52/par.c:760: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(errmsg, "<Tab> must not be 0.\n"); data/par-1.52/par.c:858:9: [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(errmsg, data/par-1.52/par.c:899:10: [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(errmsg,"%.*s\n",errmsg_size,strerror(errno)); data/par-1.52/reformat.c:250: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(errmsg, "Cannot justify.\n"); data/par-1.52/reformat.c:337:7: [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(errmsg, data/par-1.52/reformat.c:404:9: [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(errmsg, "Word too long: %.*s\n", linelen, w2->chrs); data/par-1.52/reformat.c:479:31: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (numout <= numin) memcpy(q1, inlines[numout - 1], prefix); data/par-1.52/reformat.c:480:31: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. else if (numin > hang ) memcpy(q1, endline[-1], prefix); data/par-1.52/reformat.c:483:7: [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(q1, endline[-1], afp); data/par-1.52/reformat.c:491:9: [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(q1, w2->chrs, w2->length); data/par-1.52/reformat.c:509:31: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (numout <= numin) memcpy(q1, suffixes[numout - 1], suffix); data/par-1.52/reformat.c:510:31: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. else if (numin > hang ) memcpy(q1, suffixes[numin - 1], suffix); data/par-1.52/reformat.c:513:7: [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(q1, suffixes[numin - 1], fs); data/par-1.52/par.c:328:9: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getchar(); data/par-1.52/par.c:367:15: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(vln,ln,vlnlen); data/par-1.52/par.c:730: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). parinit = malloc((strlen(env) + 1) * sizeof (char)); data/par-1.52/par.c:772:11: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getchar(); data/par-1.52/par.c:787:15: [1] (buffer) getchar: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = getchar(); ANALYSIS SUMMARY: Hits = 45 Lines analyzed = 2202 in approximately 0.07 seconds (31233 lines/second) Physical Source Lines of Code (SLOC) = 1488 Hits@level = [0] 2 [1] 5 [2] 19 [3] 4 [4] 17 [5] 0 Hits@level+ = [0+] 47 [1+] 45 [2+] 40 [3+] 21 [4+] 17 [5+] 0 Hits/KSLOC@level+ = [0+] 31.586 [1+] 30.2419 [2+] 26.8817 [3+] 14.1129 [4+] 11.4247 [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.