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/amideco-0.31e/src/amideco.c Examining data/amideco-0.31e/src/amideco.h Examining data/amideco-0.31e/src/amihelp.h Examining data/amideco-0.31e/src/amisoft.h Examining data/amideco-0.31e/src/amiver.h Examining data/amideco-0.31e/src/kernel.c Examining data/amideco-0.31e/src/amifunc.c FINAL RESULTS: data/amideco-0.31e/src/amifunc.c:250:54: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if((atoi(Buf)>=0) && (atoi(Buf)<70)) sprintf(Buf,"%.2s %s %s%.2s",day,Months[atoi(mon)],"20",year); data/amideco-0.31e/src/amifunc.c:251:30: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. else sprintf(Buf,"%.2s %s %s%.2s",day,Months[atoi(mon)],"19",year); data/amideco-0.31e/src/amifunc.c:308:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(MyDirName, "%s.---", MyDirName); data/amideco-0.31e/src/amifunc.c:357:31: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if(doDir) sprintf(Buf, "%s/amipci_%.2X.%.2X", MyDirName, Multiple++, part.PartID); data/amideco-0.31e/src/amifunc.c:361:31: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if(doDir) sprintf(Buf, "%s/amibody.%.2x", MyDirName, part.PartID); data/amideco-0.31e/src/amideco.c:76:14: [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( (ptx = fopen(argv[1],"rb")) == NULL ) data/amideco-0.31e/src/amideco.c:146:6: [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(atoi(amidate.Day) == 10 && atoi(amidate.Month) == 10) { Offset = 0x30; AMIVer = 10; } data/amideco-0.31e/src/amideco.c:146:33: [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(atoi(amidate.Day) == 10 && atoi(amidate.Month) == 10) { Offset = 0x30; AMIVer = 10; } data/amideco-0.31e/src/amifunc.c:248:17: [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(Buf,"%2.2s",year); data/amideco-0.31e/src/amifunc.c:250:21: [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((atoi(Buf)>=0) && (atoi(Buf)<70)) sprintf(Buf,"%.2s %s %s%.2s",day,Months[atoi(mon)],"20",year); data/amideco-0.31e/src/amifunc.c:250: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((atoi(Buf)>=0) && (atoi(Buf)<70)) sprintf(Buf,"%.2s %s %s%.2s",day,Months[atoi(mon)],"20",year); data/amideco-0.31e/src/amifunc.c:250:94: [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((atoi(Buf)>=0) && (atoi(Buf)<70)) sprintf(Buf,"%.2s %s %s%.2s",day,Months[atoi(mon)],"20",year); data/amideco-0.31e/src/amifunc.c:251:70: [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). else sprintf(Buf,"%.2s %s %s%.2s",day,Months[atoi(mon)],"19",year); data/amideco-0.31e/src/amifunc.c:304: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(MyDirName, (fname + i), sLen - i); data/amideco-0.31e/src/amifunc.c:358:30: [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(Buf, "amipci_%.2X.%.2X", Multiple++, part.PartID); data/amideco-0.31e/src/amifunc.c:362:30: [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(Buf,"amibody.%.2x", part.PartID); data/amideco-0.31e/src/amifunc.c:365:27: [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((pto = fopen(Buf,"wb")) == NULL) { data/amideco-0.31e/src/amifunc.c:428:17: [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(Buf,"amibody.%.2x",Module++); data/amideco-0.31e/src/amifunc.c:429:23: [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). pto = fopen(Buf,"wb"); data/amideco-0.31e/src/amifunc.c:547:17: [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(Buf,"amibody.%.2x",Module++); data/amideco-0.31e/src/amifunc.c:548:23: [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). pto = fopen(Buf,"wb"); data/amideco-0.31e/src/amifunc.c:588: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(Buf,"amibody.%.2x",Module++); data/amideco-0.31e/src/amifunc.c:589:15: [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). pto = fopen(Buf,"wb"); data/amideco-0.31e/src/kernel.c:49:10: [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. unsigned char c_len[NC], pt_len[NPT]; data/amideco-0.31e/src/kernel.c:130:48: [1] (buffer) getc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). compsize--; subbitbuf = (unsigned char) getc(infile); ANALYSIS SUMMARY: Hits = 25 Lines analyzed = 1386 in approximately 0.05 seconds (29288 lines/second) Physical Source Lines of Code (SLOC) = 1028 Hits@level = [0] 61 [1] 1 [2] 19 [3] 0 [4] 5 [5] 0 Hits@level+ = [0+] 86 [1+] 25 [2+] 24 [3+] 5 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 83.6576 [1+] 24.3191 [2+] 23.3463 [3+] 4.86381 [4+] 4.86381 [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.