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/aspic-1.05/src/rdsubs.c Examining data/aspic-1.05/src/mytypes.h Examining data/aspic-1.05/src/tables.c Examining data/aspic-1.05/src/read.c Examining data/aspic-1.05/src/tree.c Examining data/aspic-1.05/src/wrps.c Examining data/aspic-1.05/src/wrsg.c Examining data/aspic-1.05/src/wrsv.c Examining data/aspic-1.05/src/aspic.c Examining data/aspic-1.05/src/aspic.h Examining data/aspic-1.05/src/rditem.c Examining data/aspic-1.05/src/write.c FINAL RESULTS: data/aspic-1.05/src/mytypes.h:44:28: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. #define Uchmod(s,n) chmod(CCS(s),n) data/aspic-1.05/src/mytypes.h:45:28: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. #define Uchown(s,n,m) chown(CCS(s),n,m) data/aspic-1.05/src/aspic.c:152:1: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, CS error_messages[n], ap); data/aspic-1.05/src/mytypes.h:59:28: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). #define Ustrcat(s,t) strcat(CS(s),CCS(t)) data/aspic-1.05/src/mytypes.h:64:28: [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). #define Ustrcpy(s,t) strcpy(CS(s),CCS(t)) data/aspic-1.05/src/write.c:319:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. n = sprintf(CS(p + n), "%" U_FORMAT, x/1000); data/aspic-1.05/src/wrsv.c:133:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(CS stroke, "\"#%02X%02X%02X\" stroke-width=\"%s\"", data/aspic-1.05/src/wrsv.c:143:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(CS p, " stroke-dasharray=\"%s,%s\"", fixed(d1), fixed(d2)); data/aspic-1.05/src/aspic.c:225:1: [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(&local, localtime(&now), sizeof(struct tm)); data/aspic-1.05/src/aspic.c:237:8: [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. (void) sprintf(CS timebuf + len, "%02d ", local.tm_mday); data/aspic-1.05/src/aspic.c:240:8: [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. (void) sprintf(CS timebuf + len, " %+03d%02d", diff_hour, diff_min); data/aspic-1.05/src/aspic.c:358:21: [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). if ((main_input = fopen(argv[firstarg], "r")) == NULL) data/aspic-1.05/src/aspic.c:405:21: [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). if ((out_file = fopen(argv[firstarg + 1], "w")) == NULL) data/aspic-1.05/src/mytypes.h:41:28: [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). #define Uatoi(s) atoi(CCS(s)) data/aspic-1.05/src/mytypes.h:42:28: [2] (integer) atol: 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). #define Uatol(s) atol(CCS(s)) data/aspic-1.05/src/mytypes.h:47:28: [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). #define Ufopen(s,t) fopen(CCS(s),CCS(t)) data/aspic-1.05/src/mytypes.h:52:28: [2] (misc) open: 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). #define Uopen(s,n,m) open(CCS(s),(n)|O_BINARY,m) /* where all files must */ data/aspic-1.05/src/mytypes.h:54:28: [2] (misc) open: 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). #define Uopen(s,n,m) open(CCS(s),n,m) /* to avoid problems */ data/aspic-1.05/src/rdsubs.c:236:13: [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(CS t, "%d", macro_id); /* Avoid ANSI use of sprintf() yield */ data/aspic-1.05/src/read.c:129:6: [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). nf = fopen(CS word, "r"); data/aspic-1.05/src/read.c:618:1: [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(newenv, env, sizeof(environment)); data/aspic-1.05/src/read.c:723:1: [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(mm, m, sizeof(macro)); data/aspic-1.05/src/write.c:321:8: [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. if (n) sprintf(CS(p + Ustrlen(p)), ".%03d", n); data/aspic-1.05/src/wrsg.c:25:8: [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 char fixed_buffer[100]; data/aspic-1.05/src/wrsv.c:126:8: [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. else sprintf(CS fill, "\"#%02X%02X%02X\"", data/aspic-1.05/src/wrsv.c:311:8: [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. else sprintf(CS fill, "\"#%02X%02X%02X\"", data/aspic-1.05/src/mytypes.h:56:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define Uread(f,b,l) read(f,CS(b),l) data/aspic-1.05/src/mytypes.h:67:33: [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). #define Ustrlen(s) (int)strlen(CCS(s)) data/aspic-1.05/src/mytypes.h:68:28: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. #define Ustrncat(s,t,n) strncat(CS(s),CCS(t),n) data/aspic-1.05/src/mytypes.h:70:28: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). #define Ustrncpy(s,t,n) strncpy(CS(s),CCS(t),n) ANALYSIS SUMMARY: Hits = 30 Lines analyzed = 8448 in approximately 0.27 seconds (31218 lines/second) Physical Source Lines of Code (SLOC) = 5786 Hits@level = [0] 119 [1] 4 [2] 18 [3] 0 [4] 6 [5] 2 Hits@level+ = [0+] 149 [1+] 30 [2+] 26 [3+] 8 [4+] 8 [5+] 2 Hits/KSLOC@level+ = [0+] 25.7518 [1+] 5.18493 [2+] 4.49361 [3+] 1.38265 [4+] 1.38265 [5+] 0.345662 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.