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/fakeroot-1.25.3/communicate.c Examining data/fakeroot-1.25.3/communicate.h Examining data/fakeroot-1.25.3/faked.c Examining data/fakeroot-1.25.3/libfakeroot_inode64.c Examining data/fakeroot-1.25.3/libfakeroot_unix2003.c Examining data/fakeroot-1.25.3/patchattr.h Examining data/fakeroot-1.25.3/setenv.c Examining data/fakeroot-1.25.3/simple.c Examining data/fakeroot-1.25.3/statconv/glibc/linux/alpha/stats.h Examining data/fakeroot-1.25.3/libfakeroot.c Examining data/fakeroot-1.25.3/message.h FINAL RESULTS: data/fakeroot-1.25.3/libfakeroot.c:798:5: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. int chown(const char *path, uid_t owner, gid_t group){ data/fakeroot-1.25.3/libfakeroot.c:912:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. int chmod(const char *path, mode_t mode){ data/fakeroot-1.25.3/communicate.c:805: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(buf.xattr.buf, xattr->name); data/fakeroot-1.25.3/communicate.c:891: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(buf.xattr.buf, xattr->name); data/fakeroot-1.25.3/faked.c:906: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(&buf->xattr.buf[bsize], x->key); data/fakeroot-1.25.3/faked.c:1234:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, FAKEROOT_CLEANUPMSG, g); data/fakeroot-1.25.3/libfakeroot.c:2149:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(savekey, "FAKEROOTKEY=%s", frk); data/fakeroot-1.25.3/libfakeroot.c:2156:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(savemode, "FAKED_MODE=%s", fdm); data/fakeroot-1.25.3/libfakeroot.c:2225:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(*insenvp, "DYLD_INSERT_LIBRARIES=%s:%s", dylib_insert, data/fakeroot-1.25.3/libfakeroot.c:2237:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(*insenvp, "DYLD_INSERT_LIBRARIES=%s", dylib_insert); data/fakeroot-1.25.3/libfakeroot.c:2269:5: [4] (shell) execv: 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. int execv(const char *path, char *const argv[]) data/fakeroot-1.25.3/libfakeroot.c:2292:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buff + plen, "%s%s", plen ? "/" : "", file); data/fakeroot-1.25.3/libfakeroot.c:2293:58: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (stat(buff, &info) || !S_ISREG(info.st_mode) || access(buff, X_OK)) data/fakeroot-1.25.3/libfakeroot.c:2319:5: [4] (shell) execvp: 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. int execvp(const char *file, char *const argv[]) data/fakeroot-1.25.3/libfakeroot.c:2356:5: [4] (shell) execl: 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. int execl(const char *path, const char *arg0, ...) data/fakeroot-1.25.3/libfakeroot.c:2371:5: [4] (shell) execle: 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. int execle(const char *path, const char *arg0, ...) data/fakeroot-1.25.3/libfakeroot.c:2387:5: [4] (shell) execlp: 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. int execlp(const char *file, const char *arg0, ...) data/fakeroot-1.25.3/libfakeroot.c:2397:12: [4] (shell) execvp: 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. result = execvp(file, arglist); data/fakeroot-1.25.3/communicate.c:92:5: [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. s=getenv(env); data/fakeroot-1.25.3/faked.c:577:11: [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. roots = getenv(DB_SEARCH_PATHS_ENV); data/fakeroot-1.25.3/faked.c:1318:6: [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. if(getenv(FAKEROOTKEY_ENV)) { data/fakeroot-1.25.3/faked.c:1383:7: [3] (random) srandom: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srandom(time(NULL)+getpid()*33151); data/fakeroot-1.25.3/faked.c:1386:17: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. msg_key=random(); data/fakeroot-1.25.3/libfakeroot.c:252:7: [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. if (getenv("FAKEROOT_DEBUG")) { data/fakeroot-1.25.3/libfakeroot.c:291:15: [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. char *str = getenv(key); data/fakeroot-1.25.3/libfakeroot.c:2143:21: [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. const char *dil = getenv("DYLD_INSERT_LIBRARIES"); data/fakeroot-1.25.3/libfakeroot.c:2144:36: [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. const char *frk = fakeroot_key = getenv("FAKEROOTKEY"); data/fakeroot-1.25.3/libfakeroot.c:2145:34: [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. const char *fdm = faked_mode = getenv("FAKED_MODE"); data/fakeroot-1.25.3/libfakeroot.c:2186:7: [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. getenv("FAKEROOT_TEST_PRELOAD")) data/fakeroot-1.25.3/libfakeroot.c:2321:22: [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. const char *path = getenv("PATH"); data/fakeroot-1.25.3/libfakeroot.c:2439:29: [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. const char *search_path = getenv("PATH"); data/fakeroot-1.25.3/communicate.c:453:12: [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). port = atoi(str); data/fakeroot-1.25.3/communicate.c:625: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(fm.xattr.buf, buf->xattr.buf, MAX_IPC_BUFFER_SIZE); data/fakeroot-1.25.3/communicate.c:807:9: [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(&buf.xattr.buf[name_size + 1], xattr->value, in_size); data/fakeroot-1.25.3/communicate.c:824:7: [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(xattr->value, buf.xattr.buf, xattr->size); data/fakeroot-1.25.3/communicate.c:893:9: [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(&buf.xattr.buf[name_size + 1], xattr->value, in_size); data/fakeroot-1.25.3/communicate.c:910:7: [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(xattr->value, buf.xattr.buf, xattr->size); data/fakeroot-1.25.3/communicate.c:927:11: [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). key=atoi(s); data/fakeroot-1.25.3/communicate.c:976:15: [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). get_ipc_key(atoi(key)); data/fakeroot-1.25.3/faked.c:287: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(node->value, value, value_size); data/fakeroot-1.25.3/faked.c:340: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(&n->buf, buf, sizeof (struct fakestat)); data/fakeroot-1.25.3/faked.c:459: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(fm.xattr.buf, buf->xattr.buf, MAX_IPC_BUFFER_SIZE); data/fakeroot-1.25.3/faked.c:565: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 path[DB_PATH_LEN + 1]; data/fakeroot-1.25.3/faked.c:593:8: [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(save_file,O_WRONLY|O_NONBLOCK); data/fakeroot-1.25.3/faked.c:603:5: [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). f=fopen(save_file, "w"); data/fakeroot-1.25.3/faked.c:635: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 path[DB_PATH_LEN + 1]; data/fakeroot-1.25.3/faked.c:708:2: [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(data_node_get(i), st, sizeof (struct fakestat)); data/fakeroot-1.25.3/faked.c:1012:5: [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(buf->xattr.buf, x->value, x->value_size); data/fakeroot-1.25.3/faked.c:1167: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 host[256]; data/fakeroot-1.25.3/faked.c:1261:12: [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). return atoi(*argv); data/fakeroot-1.25.3/libfakeroot.c:293:12: [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). return atoi(str); data/fakeroot-1.25.3/libfakeroot.c:302: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 str[12]; data/fakeroot-1.25.3/libfakeroot.c:1066:6: [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(pathname, O_WRONLY|O_CREAT|O_TRUNC, 00644); data/fakeroot-1.25.3/libfakeroot.c:1363:7: [2] (race) vfork: On some old systems, vfork() permits race conditions, and it's very difficult to use correctly (CWE-362). Use fork() instead. pid_t vfork(void) data/fakeroot-1.25.3/libfakeroot.c:2195: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(altenv, envp, (envcount + 1) * sizeof(char *)); data/fakeroot-1.25.3/libfakeroot.c:2220:21: [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. *insenvp = (char *)malloc(strlen(altenv[i]) + strlen(dylib_insert) + 2); data/fakeroot-1.25.3/libfakeroot.c:2291:7: [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(buff, search_path, plen); data/fakeroot-1.25.3/libfakeroot.c:2406:47: [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. int posix_spawn(pid_t * __restrict pid, const char * __restrict path, data/fakeroot-1.25.3/libfakeroot.c:2409:17: [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 *const argv[ __restrict], char *const envp[ __restrict]) data/fakeroot-1.25.3/libfakeroot.c:2409:48: [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 *const argv[ __restrict], char *const envp[ __restrict]) data/fakeroot-1.25.3/libfakeroot.c:2433:48: [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. int posix_spawnp(pid_t * __restrict pid, const char * __restrict file, data/fakeroot-1.25.3/libfakeroot.c:2436:18: [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 *const argv[ __restrict], char *const envp[ __restrict]) data/fakeroot-1.25.3/libfakeroot.c:2436:49: [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 *const argv[ __restrict], char *const envp[ __restrict]) data/fakeroot-1.25.3/message.h:74: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[MAX_IPC_BUFFER_SIZE]; data/fakeroot-1.25.3/setenv.c:160:4: [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 new_value[namelen + 1 + vallen]; data/fakeroot-1.25.3/setenv.c:168:4: [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 (new_value, name, namelen); data/fakeroot-1.25.3/setenv.c:170:4: [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 (&new_value[namelen + 1], value, vallen); data/fakeroot-1.25.3/setenv.c:186:8: [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 (new_environ[size], new_value, namelen + 1 + vallen); data/fakeroot-1.25.3/setenv.c:188:8: [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 (new_environ[size], name, namelen); data/fakeroot-1.25.3/setenv.c:190:8: [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 (&new_environ[size][namelen + 1], value, vallen); data/fakeroot-1.25.3/setenv.c:200:2: [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 ((char *) new_environ, (char *) __environ, data/fakeroot-1.25.3/setenv.c:218:4: [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 new_value[namelen + 1 + vallen]; data/fakeroot-1.25.3/setenv.c:226:4: [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 (new_value, name, namelen); data/fakeroot-1.25.3/setenv.c:228:4: [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 (&new_value[namelen + 1], value, vallen); data/fakeroot-1.25.3/setenv.c:243:8: [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 (np, new_value, namelen + 1 + vallen); data/fakeroot-1.25.3/setenv.c:245:8: [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 (np, name, namelen); data/fakeroot-1.25.3/setenv.c:247:8: [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 (&np[namelen + 1], value, vallen); data/fakeroot-1.25.3/communicate.c:599:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read(fd,buf+(count-remaining),remaining); data/fakeroot-1.25.3/communicate.c:796: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). name_size = strlen(xattr->name); data/fakeroot-1.25.3/communicate.c:882: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). name_size = strlen(xattr->name); data/fakeroot-1.25.3/communicate.c:967:16: [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 (!key || !strlen(key)) data/fakeroot-1.25.3/faked.c:491:26: [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). const size_t pathlen = strlen(path) + strlen("/"); data/fakeroot-1.25.3/faked.c:491:41: [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). const size_t pathlen = strlen(path) + strlen("/"); data/fakeroot-1.25.3/faked.c:494:3: [1] (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 character. strcat(path, "/"); data/fakeroot-1.25.3/faked.c:507:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path + pathlen, ent->d_name, DB_PATH_LEN - pathlen); data/fakeroot-1.25.3/faked.c:511:7: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path + pathlen, ent->d_name, DB_PATH_LEN - pathlen); data/fakeroot-1.25.3/faked.c:550:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(path, roots + start, len); data/fakeroot-1.25.3/faked.c:900: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). int keysize = strlen(x->key); data/fakeroot-1.25.3/faked.c:933: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). key_size = strlen(buf->xattr.buf); data/fakeroot-1.25.3/faked.c:1271:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). len = read(comm_sd, buf, sizeof (struct fake_msg)); data/fakeroot-1.25.3/libfakeroot.c:1057:19: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mode_t old_mask=umask(022); data/fakeroot-1.25.3/libfakeroot.c:1060:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(old_mask); data/fakeroot-1.25.3/libfakeroot.c:1095:19: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mode_t old_mask=umask(022); data/fakeroot-1.25.3/libfakeroot.c:1098:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(old_mask); data/fakeroot-1.25.3/libfakeroot.c:1132:19: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mode_t old_mask=umask(022); data/fakeroot-1.25.3/libfakeroot.c:1134:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(old_mask); data/fakeroot-1.25.3/libfakeroot.c:1167:19: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). mode_t old_mask=umask(022); data/fakeroot-1.25.3/libfakeroot.c:1169:3: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(old_mask); data/fakeroot-1.25.3/libfakeroot.c:2147:41: [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 *savekey = (char *)malloc(12 + strlen(frk) + 1); data/fakeroot-1.25.3/libfakeroot.c:2154:42: [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 *savemode = (char *)malloc(11 + strlen(fdm) + 1); data/fakeroot-1.25.3/libfakeroot.c:2220:35: [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). *insenvp = (char *)malloc(strlen(altenv[i]) + strlen(dylib_insert) + 2); data/fakeroot-1.25.3/libfakeroot.c:2220:55: [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). *insenvp = (char *)malloc(strlen(altenv[i]) + strlen(dylib_insert) + 2); data/fakeroot-1.25.3/libfakeroot.c:2232: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). *insenvp = (char *)malloc(22 + strlen(dylib_insert) + 1); data/fakeroot-1.25.3/libfakeroot.c:2278:20: [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). size_t splen = strlen(search_path); data/fakeroot-1.25.3/libfakeroot.c:2281:25: [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 *buff = malloc(strlen(file) + splen + 2); data/fakeroot-1.25.3/libfakeroot.c:2498:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buf, "sparcv9 sparc", count - 1); data/fakeroot-1.25.3/libfakeroot.c:2501:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buf, "sparcv7 sparc", count - 1); data/fakeroot-1.25.3/libfakeroot.c:2505:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(buf, "i386 i86", count - 1); data/fakeroot-1.25.3/setenv.c:118:26: [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). const size_t namelen = strlen (name); data/fakeroot-1.25.3/setenv.c:119:41: [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). const size_t vallen = value != NULL ? strlen (value) + 1 : 0; data/fakeroot-1.25.3/setenv.c:290:9: [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 (name); ANALYSIS SUMMARY: Hits = 111 Lines analyzed = 6335 in approximately 0.17 seconds (37656 lines/second) Physical Source Lines of Code (SLOC) = 4811 Hits@level = [0] 119 [1] 34 [2] 46 [3] 13 [4] 16 [5] 2 Hits@level+ = [0+] 230 [1+] 111 [2+] 77 [3+] 31 [4+] 18 [5+] 2 Hits/KSLOC@level+ = [0+] 47.8071 [1+] 23.0721 [2+] 16.005 [3+] 6.44357 [4+] 3.74143 [5+] 0.415714 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.