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/rexima-1.4/rexima.c FINAL RESULTS: data/rexima-1.4/rexima.c:325:7: [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(mixerdev,optnarg); data/rexima-1.4/rexima.c:40: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 dev_labels[SOUND_MIXER_NRDEVICES][80]=SOUND_DEVICE_LABELS; data/rexima-1.4/rexima.c:41: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 dev_names [SOUND_MIXER_NRDEVICES][80]=SOUND_DEVICE_NAMES; data/rexima-1.4/rexima.c:108:14: [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(((*mixfd)=open(mixerdev,O_RDWR))<0) die("open mixer device"); data/rexima-1.4/rexima.c:212: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 buf[60]; data/rexima-1.4/rexima.c:227: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,"%3d%%",level); data/rexima-1.4/rexima.c:455:9: [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). l=atoi(argv[optnind]); data/rexima-1.4/rexima.c:456:9: [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). r=atoi(ptr+1); data/rexima-1.4/rexima.c:465:36: [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). 2*offset_sign:atoi(argv[optnind])); data/rexima-1.4/rexima.c:467:34: [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). mixer_setlevel(mixfd,tmp,atoi(argv[optnind])); data/rexima-1.4/rexima.c:64:46: [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(optnind==argc || *(argv[optnind])!='-' || strlen(argv[optnind])<=1) data/rexima-1.4/rexima.c:87:12: [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(optnpos>strlen(argv[optnind])) data/rexima-1.4/rexima.c:323:27: [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((mixerdev=malloc(strlen(optnarg)+1))==NULL) data/rexima-1.4/rexima.c:438: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). for(f=(offset_sign?1:0);f<strlen(argv[optnind]);f++) data/rexima-1.4/rexima.c:464:23: [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). (strlen(argv[optnind])<2)? ANALYSIS SUMMARY: Hits = 15 Lines analyzed = 578 in approximately 0.02 seconds (23747 lines/second) Physical Source Lines of Code (SLOC) = 426 Hits@level = [0] 16 [1] 5 [2] 9 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 31 [1+] 15 [2+] 10 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 72.77 [1+] 35.2113 [2+] 23.4742 [3+] 2.34742 [4+] 2.34742 [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.