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/cycfx2prog-0.47/cycfx2dev.h Examining data/cycfx2prog-0.47/cycfx2dev.cc Examining data/cycfx2prog-0.47/cycfx2prog.cc FINAL RESULTS: data/cycfx2prog-0.47/cycfx2prog.cc:116:7: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. { printf((j && !(j%8)) ? " " : " "); } data/cycfx2prog-0.47/cycfx2prog.cc:236:4: [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(dev,p+1); data/cycfx2prog-0.47/cycfx2prog.cc:271:3: [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(cmd,arg[argc_i]); data/cycfx2prog-0.47/cycfx2dev.cc:394:12: [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 data[nbytes]; data/cycfx2prog-0.47/cycfx2dev.cc:436:11: [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). FILE *fp=fopen(path,"r"); data/cycfx2prog-0.47/cycfx2dev.cc:444: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[buflen]; data/cycfx2prog-0.47/cycfx2dev.cc:493:11: [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). int fd=::open(path,O_RDONLY); data/cycfx2prog-0.47/cycfx2dev.cc:500: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[buflen]; data/cycfx2prog-0.47/cycfx2dev.cc:545:23: [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). int CypressFX2Device::open(struct usb_device *_usbdev) data/cycfx2prog-0.47/cycfx2dev.h:52:7: [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). int open(struct usb_device *_usbdev); data/cycfx2prog-0.47/cycfx2prog.cc:228: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 bus[16]; data/cycfx2prog-0.47/cycfx2prog.cc:229: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 dev[16]; data/cycfx2prog-0.47/cycfx2prog.cc:261:12: [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). if(cycfx2.open(usbdev)) data/cycfx2prog-0.47/cycfx2prog.cc:275: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 *a[MAXARGS]; data/cycfx2prog-0.47/cycfx2prog.cc:447:31: [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). FILE *stream = filename ? fopen(filename,"r") : stdin; data/cycfx2prog-0.47/cycfx2prog.cc:457:14: [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[chunk_size]; data/cycfx2prog-0.47/cycfx2dev.cc:137:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return(read ? read : (error ? -1 : 0)); data/cycfx2prog-0.47/cycfx2dev.cc:137:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return(read ? read : (error ? -1 : 0)); data/cycfx2prog-0.47/cycfx2dev.cc:214:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return(read ? read : (error ? -1 : 0)); data/cycfx2prog-0.47/cycfx2dev.cc:214:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return(read ? read : (error ? -1 : 0)); data/cycfx2prog-0.47/cycfx2dev.cc:504:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t rd=read(fd,buf,buflen); data/cycfx2prog-0.47/cycfx2prog.cc:231:7: [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(strlen(arg_bus_dev)>=16) break; // Prevents buffer overflows. data/cycfx2prog-0.47/cycfx2prog.cc:234:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(bus,arg_bus_dev,p-arg_bus_dev); data/cycfx2prog-0.47/cycfx2prog.cc:270:39: [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). char *cmd=(char*)CheckMalloc(malloc(strlen(arg[argc_i])+1)); data/cycfx2prog-0.47/cycfx2prog.cc:337:4: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(delay*1000); data/cycfx2prog-0.47/cycfx2prog.cc:416: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 len=str ? strlen(str) : 0; ANALYSIS SUMMARY: Hits = 26 Lines analyzed = 1199 in approximately 0.07 seconds (17714 lines/second) Physical Source Lines of Code (SLOC) = 943 Hits@level = [0] 87 [1] 10 [2] 13 [3] 0 [4] 3 [5] 0 Hits@level+ = [0+] 113 [1+] 26 [2+] 16 [3+] 3 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 119.83 [1+] 27.5716 [2+] 16.9671 [3+] 3.18134 [4+] 3.18134 [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.