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/pd-cxc-0.5.2/ascseq.c Examining data/pd-cxc-0.5.2/cxavgdev.c Examining data/pd-cxc-0.5.2/cxc.c Examining data/pd-cxc-0.5.2/reson~.c Examining data/pd-cxc-0.5.2/random_tw.c Examining data/pd-cxc-0.5.2/bfilt2.c Examining data/pd-cxc-0.5.2/ENV.c Examining data/pd-cxc-0.5.2/cxc_prepend.c Examining data/pd-cxc-0.5.2/cxstddev.c Examining data/pd-cxc-0.5.2/hex2dec.c Examining data/pd-cxc-0.5.2/proc.c Examining data/pd-cxc-0.5.2/bfilt.c Examining data/pd-cxc-0.5.2/cxmean.c Examining data/pd-cxc-0.5.2/cxc_counter.c Examining data/pd-cxc-0.5.2/ixprint.c Examining data/pd-cxc-0.5.2/utime.c Examining data/pd-cxc-0.5.2/ascwave.c Examining data/pd-cxc-0.5.2/delta~.c Examining data/pd-cxc-0.5.2/cxc.h Examining data/pd-cxc-0.5.2/mean~.c Examining data/pd-cxc-0.5.2/random_icg~.c Examining data/pd-cxc-0.5.2/random_icg.c Examining data/pd-cxc-0.5.2/random1.c Examining data/pd-cxc-0.5.2/random1~.c Examining data/pd-cxc-0.5.2/random_fl.c Examining data/pd-cxc-0.5.2/random_fl~.c Examining data/pd-cxc-0.5.2/dist_normal.c Examining data/pd-cxc-0.5.2/cxc_split.c FINAL RESULTS: data/pd-cxc-0.5.2/ascseq.c:61:5: [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). strcat(x->x_bla,s->s_name); data/pd-cxc-0.5.2/ascseq.c:67:5: [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). strcat(x->x_bla,tmp); data/pd-cxc-0.5.2/hex2dec.c:29:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, x->x_format->s_name, (int)f); data/pd-cxc-0.5.2/hex2dec.c:36:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, x->x_format->s_name, s->s_name); data/pd-cxc-0.5.2/proc.c:62:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name,"%s","/proc/cpuinfo"); data/pd-cxc-0.5.2/proc.c:78:10: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. ac = fscanf(fp,"%s\t: %f",name,&restf); data/pd-cxc-0.5.2/proc.c:126:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(name,"/proc/%s",s->s_name); data/pd-cxc-0.5.2/proc.c:147:12: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. ac = fscanf(fp,"%s\t: %f",name,&restf); data/pd-cxc-0.5.2/proc.c:192:12: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. ac = fscanf(fp,"%s %s %d.%d.%d *",name,rest,&a,&b,&c); data/pd-cxc-0.5.2/ENV.c:42:9: [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. env = getenv(s->s_name); data/pd-cxc-0.5.2/ascseq.c:23: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 x_bla[MAXMSGLEN]; data/pd-cxc-0.5.2/ascseq.c:51: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 tmp[MAXMSGLEN]; data/pd-cxc-0.5.2/ascseq.c:104:3: [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(x->x_bla,"%f",f); data/pd-cxc-0.5.2/ascwave.c:12:19: [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 sys_fopen fopen data/pd-cxc-0.5.2/cxc_split.c:63: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 u[MAXPDSTRING]; data/pd-cxc-0.5.2/cxc_split.c:64: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 v[MAXPDSTRING]; data/pd-cxc-0.5.2/cxc_split.c:152: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 u[2]; u[0] = '\0'; u[1] = '\0'; data/pd-cxc-0.5.2/hex2dec.c:28:5: [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[MAXPDSTRING]; data/pd-cxc-0.5.2/hex2dec.c:35:5: [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[MAXPDSTRING]; data/pd-cxc-0.5.2/ixprint.c:41:5: [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[80]; data/pd-cxc-0.5.2/ixprint.c:52:5: [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[80]; data/pd-cxc-0.5.2/proc.c:17:19: [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 sys_fopen fopen data/pd-cxc-0.5.2/proc.c:51: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[255]; // filename data/pd-cxc-0.5.2/proc.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 rest[255]; // string value data/pd-cxc-0.5.2/proc.c:54: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 bla[1]; data/pd-cxc-0.5.2/proc.c:108: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[255]; // filename data/pd-cxc-0.5.2/proc.c:109: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 rest[255]; // string value data/pd-cxc-0.5.2/proc.c:116: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 bla[1]; data/pd-cxc-0.5.2/ascseq.c:75:17: [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). x->x_toklen = strlen(x->x_bla); data/pd-cxc-0.5.2/ascseq.c:105:17: [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). x->x_toklen = strlen(x->x_bla); data/pd-cxc-0.5.2/cxc_split.c:71: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). for(j=0; j<strlen(s->s_name); j++) { data/pd-cxc-0.5.2/cxc_split.c:88:7: [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. strncat(v, u, 1); data/pd-cxc-0.5.2/cxc_split.c:154:6: [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(s->s_name) > 1) { data/pd-cxc-0.5.2/cxc_split.c:157:5: [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. strncat(u, s->s_name, 1); ANALYSIS SUMMARY: Hits = 34 Lines analyzed = 3409 in approximately 0.10 seconds (35010 lines/second) Physical Source Lines of Code (SLOC) = 2434 Hits@level = [0] 3 [1] 6 [2] 18 [3] 1 [4] 9 [5] 0 Hits@level+ = [0+] 37 [1+] 34 [2+] 28 [3+] 10 [4+] 9 [5+] 0 Hits/KSLOC@level+ = [0+] 15.2013 [1+] 13.9688 [2+] 11.5037 [3+] 4.10846 [4+] 3.69762 [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.