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/cdde-0.3.1/src/util.c Examining data/cdde-0.3.1/src/string.h Examining data/cdde-0.3.1/src/list.c Examining data/cdde-0.3.1/src/util.h Examining data/cdde-0.3.1/src/configfile.c Examining data/cdde-0.3.1/src/configfile.h Examining data/cdde-0.3.1/src/cdde.c Examining data/cdde-0.3.1/src/list.h Examining data/cdde-0.3.1/src/string.c Examining data/cdde-0.3.1/src/cdde.h FINAL RESULTS: data/cdde-0.3.1/src/string.c:64:2: [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(dst, left); data/cdde-0.3.1/src/util.c:79:12: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. status = system(command); data/cdde-0.3.1/src/cdde.c:417:30: [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. filename = (char *) strdup(getenv("HOME")); data/cdde-0.3.1/src/util.c:116:14: [3] (buffer) getopt_long: 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. while ((c = getopt_long(argc, argv, "c:Vvhrb", long_options, &longindex)) != -1) data/cdde-0.3.1/src/cdde.c:196: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). fd = open(device, O_RDONLY); data/cdde-0.3.1/src/cdde.c:281: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). fd = open(d->filename, O_RDONLY | O_NONBLOCK); data/cdde-0.3.1/src/cdde.c:419:23: [2] (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). Risk is low because the source is a constant string. filename = (char *) strcat(filename, "/.cdde.xml"); data/cdde-0.3.1/src/string.c:57:3: [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(dst, left, cnt); data/cdde-0.3.1/src/string.c:59:3: [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(dst, newstr, newlen); data/cdde-0.3.1/src/cdde.c:167:2: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd, var, width); data/cdde-0.3.1/src/cdde.c:228:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd, &len_di, 1); data/cdde-0.3.1/src/cdde.c:233:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd, &parent, 2); data/cdde-0.3.1/src/cdde.c:239:3: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read(fd, dirname, len_di); data/cdde-0.3.1/src/cdde.c:418:34: [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). filename = realloc(filename, ((strlen(filename)+1) + strlen("/.cdde.xml")) * sizeof(char)); data/cdde-0.3.1/src/cdde.c:418:56: [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). filename = realloc(filename, ((strlen(filename)+1) + strlen("/.cdde.xml")) * sizeof(char)); data/cdde-0.3.1/src/cdde.c:475:3: [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); data/cdde-0.3.1/src/string.c:45:8: [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). len = strlen(str); data/cdde-0.3.1/src/string.c:46: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). oldlen = strlen(oldstr); data/cdde-0.3.1/src/string.c:50: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). newlen = strlen(newstr); data/cdde-0.3.1/src/string.c:65:21: [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). buf = realloc(buf, strlen(buf) + 1); data/cdde-0.3.1/src/util.c:67:19: [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 (!command || !strlen(command)) return; data/cdde-0.3.1/src/util.c:181:2: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(0); ANALYSIS SUMMARY: Hits = 22 Lines analyzed = 1378 in approximately 0.32 seconds (4288 lines/second) Physical Source Lines of Code (SLOC) = 782 Hits@level = [0] 56 [1] 13 [2] 5 [3] 2 [4] 2 [5] 0 Hits@level+ = [0+] 78 [1+] 22 [2+] 9 [3+] 4 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 99.7442 [1+] 28.133 [2+] 11.509 [3+] 5.11509 [4+] 2.55754 [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.