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/haskell-unix-time-0.4.7/cbits/win_patch.h Examining data/haskell-unix-time-0.4.7/cbits/conv.c Examining data/haskell-unix-time-0.4.7/cbits/strftime.c Examining data/haskell-unix-time-0.4.7/cbits/win_patch.c Examining data/haskell-unix-time-0.4.7/cbits/strptime.c FINAL RESULTS: data/haskell-unix-time-0.4.7/cbits/win_patch.c:111: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(sname, var); data/haskell-unix-time-0.4.7/cbits/win_patch.c:113: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(sname + varlen + 1, val); data/haskell-unix-time-0.4.7/cbits/win_patch.c:123: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(sname, name); data/haskell-unix-time-0.4.7/cbits/win_patch.h:134:33: [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. #define fprintf_l(fp, loc, ...) fprintf(fp, ##__VA_ARGS__) data/haskell-unix-time-0.4.7/cbits/win_patch.h:135:34: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. #define sprintf_l(buf, loc, ...) sprintf(buf, ##__VA_ARGS__) data/haskell-unix-time-0.4.7/cbits/conv.c:51:10: [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. tz = getenv("TZ"); data/haskell-unix-time-0.4.7/cbits/strftime.c:88:25: [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. if (warn != IN_NONE && getenv(YEAR_2000_NAME) != NULL) { data/haskell-unix-time-0.4.7/cbits/strftime.c:309: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 buf[INT_STRLEN_MAXIMUM( data/haskell-unix-time-0.4.7/cbits/strftime.c:583: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 buf[INT_STRLEN_MAXIMUM(int) + 1]; data/haskell-unix-time-0.4.7/cbits/win_patch.h:138: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. const char *mon[12]; data/haskell-unix-time-0.4.7/cbits/win_patch.h:139: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. const char *month[12]; data/haskell-unix-time-0.4.7/cbits/win_patch.h:140: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. const char *wday[7]; data/haskell-unix-time-0.4.7/cbits/win_patch.h:141: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. const char *weekday[7]; data/haskell-unix-time-0.4.7/cbits/win_patch.h:148: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. const char *alt_month[12]; data/haskell-unix-time-0.4.7/cbits/strptime.c:307: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). len = strlen(tptr->am); data/haskell-unix-time-0.4.7/cbits/strptime.c:315: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). len = strlen(tptr->pm); data/haskell-unix-time-0.4.7/cbits/strptime.c:328: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). len = strlen(tptr->weekday[i]); data/haskell-unix-time-0.4.7/cbits/strptime.c:332: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). len = strlen(tptr->wday[i]); data/haskell-unix-time-0.4.7/cbits/strptime.c:434:13: [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(tptr->alt_month[i]); data/haskell-unix-time-0.4.7/cbits/strptime.c:441:12: [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(tptr->month[i]); data/haskell-unix-time-0.4.7/cbits/strptime.c:453:12: [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(tptr->mon[i]); data/haskell-unix-time-0.4.7/cbits/strptime.c:545:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(zonestr, buf, cp - buf); data/haskell-unix-time-0.4.7/cbits/win_patch.c:107: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). int varlen = strlen(var); data/haskell-unix-time-0.4.7/cbits/win_patch.c:108: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). int vallen = strlen(val); data/haskell-unix-time-0.4.7/cbits/win_patch.c:121:15: [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). int len = strlen(name) + 2; ANALYSIS SUMMARY: Hits = 25 Lines analyzed = 1839 in approximately 0.06 seconds (28772 lines/second) Physical Source Lines of Code (SLOC) = 1369 Hits@level = [0] 0 [1] 11 [2] 7 [3] 2 [4] 5 [5] 0 Hits@level+ = [0+] 25 [1+] 25 [2+] 14 [3+] 7 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 18.2615 [1+] 18.2615 [2+] 10.2264 [3+] 5.11322 [4+] 3.6523 [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.