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/libtextwrap-0.1/textwrap.h Examining data/libtextwrap-0.1/dotextwrap.c Examining data/libtextwrap-0.1/textwrap.c FINAL RESULTS: data/libtextwrap-0.1/dotextwrap.c:48:39: [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 (argc >= 2) textwrap_columns(&t, atoi(argv[1])); data/libtextwrap-0.1/dotextwrap.c:49:35: [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 (argc >= 3) textwrap_tab(&t, atoi(argv[2])); data/libtextwrap-0.1/textwrap.c:160:3: [2] (buffer) wchar_t: 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. wchar_t c[2]; data/libtextwrap-0.1/textwrap.c:98:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(p->buf + p->len, c, len); data/libtextwrap-0.1/textwrap.c:107:32: [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). return stringt_addstrn(p, c, strlen(c)); data/libtextwrap-0.1/textwrap.c:128: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). q = out = (char *)malloc(strlen(str) + 1); data/libtextwrap-0.1/textwrap.c:261:9: [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(text); ANALYSIS SUMMARY: Hits = 7 Lines analyzed = 518 in approximately 0.03 seconds (19568 lines/second) Physical Source Lines of Code (SLOC) = 322 Hits@level = [0] 2 [1] 4 [2] 3 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 9 [1+] 7 [2+] 3 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 27.9503 [1+] 21.7391 [2+] 9.31677 [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.