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/nomarch-1.4/main.c Examining data/nomarch-1.4/readlzw.c Examining data/nomarch-1.4/readlzw.h Examining data/nomarch-1.4/readhuff.h Examining data/nomarch-1.4/readhuff.c Examining data/nomarch-1.4/readrle.h Examining data/nomarch-1.4/readrle.c FINAL RESULTS: data/nomarch-1.4/main.c:663:10: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. switch(getopt(argc,argv,"hlptUv")) data/nomarch-1.4/main.c:52: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 name[13]; data/nomarch-1.4/main.c:77: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 buf[4+2+2+2+4]; /* used to read size1/date/time/crc/size2 */ data/nomarch-1.4/main.c:245: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 buf[128]; data/nomarch-1.4/main.c:255:1: [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,"%4d-%02d-%02d %02d:%02d",year,month,day,hour,min); data/nomarch-1.4/main.c:373:1: [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 *methodstr[NUM_METHODSTR]= data/nomarch-1.4/main.c:390:8: [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((in=fopen(archive_filename,"rb"))==NULL) data/nomarch-1.4/main.c:448:8: [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((in=fopen(archive_filename,"rb"))==NULL) data/nomarch-1.4/main.c:571:43: [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(!opt_print && !test_only && (out=fopen(hdr.name,"wb"))==NULL) data/nomarch-1.4/main.c:83:4: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(fgetc(in)!=0x1a) data/nomarch-1.4/main.c:86:7: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if((c=fgetc(in))==EOF) data/nomarch-1.4/main.c:120: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). for(f=0;f<strlen(hdrp->name);f++) data/nomarch-1.4/main.c:164:9: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if((c=fgetc(in))==EOF) data/nomarch-1.4/main.c:208:6: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(fgetc(in)==EOF) return(0); data/nomarch-1.4/main.c:303:31: [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). if(tmp==NULL) tmp=match+strlen(match); data/nomarch-1.4/main.c:310:14: [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). ptr+=strlen(ptr); /* just `*', so skip to end */ data/nomarch-1.4/main.c:313:24: [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). if(tmp+1-match>strlen(ptr)) ANALYSIS SUMMARY: Hits = 17 Lines analyzed = 1380 in approximately 0.06 seconds (23520 lines/second) Physical Source Lines of Code (SLOC) = 912 Hits@level = [0] 32 [1] 8 [2] 8 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 49 [1+] 17 [2+] 9 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 53.7281 [1+] 18.6404 [2+] 9.86842 [3+] 1.09649 [4+] 0 [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.