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/prelink-0.0.20131005/src/prelinktab.h Examining data/prelink-0.0.20131005/src/arch-ppc64.c Examining data/prelink-0.0.20131005/src/mdebug.c Examining data/prelink-0.0.20131005/src/layout.c Examining data/prelink-0.0.20131005/src/md5.c Examining data/prelink-0.0.20131005/src/hashtab.h Examining data/prelink-0.0.20131005/src/crc32.c Examining data/prelink-0.0.20131005/src/undo.c Examining data/prelink-0.0.20131005/src/dwarf2.h Examining data/prelink-0.0.20131005/src/prelink.c Examining data/prelink-0.0.20131005/src/hashtab.c Examining data/prelink-0.0.20131005/src/arch-mips.c Examining data/prelink-0.0.20131005/src/arch-i386.c Examining data/prelink-0.0.20131005/src/arch-alpha.c Examining data/prelink-0.0.20131005/src/arch-sparc.c Examining data/prelink-0.0.20131005/src/arch-s390.c Examining data/prelink-0.0.20131005/src/checksum.c Examining data/prelink-0.0.20131005/src/space.c Examining data/prelink-0.0.20131005/src/arch-x86_64.c Examining data/prelink-0.0.20131005/src/reloc.h Examining data/prelink-0.0.20131005/src/arch-sparc64.c Examining data/prelink-0.0.20131005/src/verify.c Examining data/prelink-0.0.20131005/src/fptr.c Examining data/prelink-0.0.20131005/src/prelink.h Examining data/prelink-0.0.20131005/src/execle_open.c Examining data/prelink-0.0.20131005/src/execstack.c Examining data/prelink-0.0.20131005/src/doit.c Examining data/prelink-0.0.20131005/src/makecrc.c Examining data/prelink-0.0.20131005/src/arch-ppc.c Examining data/prelink-0.0.20131005/src/fptr.h Examining data/prelink-0.0.20131005/src/sha.c Examining data/prelink-0.0.20131005/src/arch-ia64.c Examining data/prelink-0.0.20131005/src/dwarf2.c Examining data/prelink-0.0.20131005/src/layout.h Examining data/prelink-0.0.20131005/src/reloc.c Examining data/prelink-0.0.20131005/src/arch-arm.c Examining data/prelink-0.0.20131005/src/md5.h Examining data/prelink-0.0.20131005/src/gather.c Examining data/prelink-0.0.20131005/src/conflict.c Examining data/prelink-0.0.20131005/src/exec.c Examining data/prelink-0.0.20131005/src/stabs.c Examining data/prelink-0.0.20131005/src/arch-cris.c Examining data/prelink-0.0.20131005/src/data.c Examining data/prelink-0.0.20131005/src/get.c Examining data/prelink-0.0.20131005/src/arch-s390x.c Examining data/prelink-0.0.20131005/src/cxx.c Examining data/prelink-0.0.20131005/src/space.h Examining data/prelink-0.0.20131005/src/arch-sh.c Examining data/prelink-0.0.20131005/src/sha.h Examining data/prelink-0.0.20131005/src/undoall.c Examining data/prelink-0.0.20131005/src/cache.c Examining data/prelink-0.0.20131005/src/dso.c Examining data/prelink-0.0.20131005/src/main.c Examining data/prelink-0.0.20131005/src/canonicalize.c Examining data/prelink-0.0.20131005/testsuite/cxx3lib1.C Examining data/prelink-0.0.20131005/testsuite/deps1lib1.c Examining data/prelink-0.0.20131005/testsuite/deps2lib1.c Examining data/prelink-0.0.20131005/testsuite/reloc1lib2.c Examining data/prelink-0.0.20131005/testsuite/tls1lib2.c Examining data/prelink-0.0.20131005/testsuite/reloc1.h Examining data/prelink-0.0.20131005/testsuite/ifunc3.c Examining data/prelink-0.0.20131005/testsuite/reloc3.c Examining data/prelink-0.0.20131005/testsuite/tls5lib1.c Examining data/prelink-0.0.20131005/testsuite/deps1lib2.c Examining data/prelink-0.0.20131005/testsuite/reloc4lib1.c Examining data/prelink-0.0.20131005/testsuite/reloc2lib1.c Examining data/prelink-0.0.20131005/testsuite/cxx3.h Examining data/prelink-0.0.20131005/testsuite/cxx3lib2.C Examining data/prelink-0.0.20131005/testsuite/deps1.h Examining data/prelink-0.0.20131005/testsuite/cxx1lib2.C Examining data/prelink-0.0.20131005/testsuite/ifunc3lib1.c Examining data/prelink-0.0.20131005/testsuite/shuffle2.c Examining data/prelink-0.0.20131005/testsuite/reloc11lib2.c Examining data/prelink-0.0.20131005/testsuite/quick1lib1.c Examining data/prelink-0.0.20131005/testsuite/layoutlib.C Examining data/prelink-0.0.20131005/testsuite/tls1.c Examining data/prelink-0.0.20131005/testsuite/reloc1.c Examining data/prelink-0.0.20131005/testsuite/reloc10lib1.c Examining data/prelink-0.0.20131005/testsuite/tls1lib1.c Examining data/prelink-0.0.20131005/testsuite/cxx3.C Examining data/prelink-0.0.20131005/testsuite/ifunctest.c Examining data/prelink-0.0.20131005/testsuite/reloc10lib3.c Examining data/prelink-0.0.20131005/testsuite/unprel1lib2.c Examining data/prelink-0.0.20131005/testsuite/quick1lib4.c Examining data/prelink-0.0.20131005/testsuite/tls4.c Examining data/prelink-0.0.20131005/testsuite/cxx1.h Examining data/prelink-0.0.20131005/testsuite/unprel1lib1.c Examining data/prelink-0.0.20131005/testsuite/shuffle6lib2.c Examining data/prelink-0.0.20131005/testsuite/tls1.h Examining data/prelink-0.0.20131005/testsuite/cxx2.C Examining data/prelink-0.0.20131005/testsuite/tls4lib1.c Examining data/prelink-0.0.20131005/testsuite/layout.C Examining data/prelink-0.0.20131005/testsuite/ifunc1.c Examining data/prelink-0.0.20131005/testsuite/tls4lib2.c Examining data/prelink-0.0.20131005/testsuite/reloc7.c Examining data/prelink-0.0.20131005/testsuite/quick1.c Examining data/prelink-0.0.20131005/testsuite/ifunc1lib1.c Examining data/prelink-0.0.20131005/testsuite/shuffle6lib1.c Examining data/prelink-0.0.20131005/testsuite/reloc10lib5.c Examining data/prelink-0.0.20131005/testsuite/tls7.c Examining data/prelink-0.0.20131005/testsuite/cxx1lib1.C Examining data/prelink-0.0.20131005/testsuite/tls6lib1.c Examining data/prelink-0.0.20131005/testsuite/quick1lib2.c Examining data/prelink-0.0.20131005/testsuite/tls2lib1.c Examining data/prelink-0.0.20131005/testsuite/shuffle9.c Examining data/prelink-0.0.20131005/testsuite/reloc5.c Examining data/prelink-0.0.20131005/testsuite/cxx1.C Examining data/prelink-0.0.20131005/testsuite/reloc2lib2.c Examining data/prelink-0.0.20131005/testsuite/tls2.c Examining data/prelink-0.0.20131005/testsuite/reloc10lib4.c Examining data/prelink-0.0.20131005/testsuite/ifunc.h Examining data/prelink-0.0.20131005/testsuite/reloc11lib3.c Examining data/prelink-0.0.20131005/testsuite/reloc4lib3.c Examining data/prelink-0.0.20131005/testsuite/ifunc1lib2.c Examining data/prelink-0.0.20131005/testsuite/reloc1lib1.c Examining data/prelink-0.0.20131005/testsuite/reloc4.c Examining data/prelink-0.0.20131005/testsuite/deps1.c Examining data/prelink-0.0.20131005/testsuite/unprel1.c Examining data/prelink-0.0.20131005/testsuite/reloc10lib2.c Examining data/prelink-0.0.20131005/testsuite/reloc10.c Examining data/prelink-0.0.20131005/testsuite/quick1lib3.c Examining data/prelink-0.0.20131005/testsuite/reloc3lib1.c Examining data/prelink-0.0.20131005/testsuite/tls3lib2.c Examining data/prelink-0.0.20131005/testsuite/reloc2.c Examining data/prelink-0.0.20131005/testsuite/shuffle8.c Examining data/prelink-0.0.20131005/testsuite/reloc11.c Examining data/prelink-0.0.20131005/testsuite/reloc4lib2.c Examining data/prelink-0.0.20131005/gelfx32/gelfx.h Examining data/prelink-0.0.20131005/gelfx/gelfx.h Examining data/prelink-0.0.20131005/gelf/gelf.c Examining data/prelink-0.0.20131005/gelf/gelf.h FINAL RESULTS: data/prelink-0.0.20131005/src/canonicalize.c:263:12: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. n = readlink (rpath, buf, path_max); data/prelink-0.0.20131005/src/dso.c:768:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (filename, "%s.#prelink#.XXXXXX", temp_base); data/prelink-0.0.20131005/src/execstack.c:108:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf (filename, "%s.#execstack#.XXXXXX", dso->filename); data/prelink-0.0.20131005/src/execstack.c:130:7: [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. execlp ("prelink", "prelink", "-u", "-o", filename, data/prelink-0.0.20131005/src/execstack.c:132:7: [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. execl (SBINDIR "/prelink", "prelink", "-u", "-o", filename, data/prelink-0.0.20131005/src/gather.c:631: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 (dir->dir, canon_name); data/prelink-0.0.20131005/src/gather.c:1350: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 (path->dir, canon_name); data/prelink-0.0.20131005/src/get.c:694: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 (stpcpy (p, "LD_TRACE_PRELINKING="), info->ent->filename); data/prelink-0.0.20131005/src/main.c:261:7: [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. system("/sbin/init U"); data/prelink-0.0.20131005/src/main.c:328:9: [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 (! access ("/proc/sys/kernel/exec-shield", F_OK)) data/prelink-0.0.20131005/src/makecrc.c:59:5: [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(i % 5 ? ", 0x%08lx" : ",\n 0x%08lx", c); data/prelink-0.0.20131005/src/layout.c:403:4: [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 (mmap_start >> 12); data/prelink-0.0.20131005/src/layout.c:405:25: [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. l.libs[i]->u.tmp = random (); data/prelink-0.0.20131005/src/main.c:345:23: [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. ld_library_path = getenv ("LD_LIBRARY_PATH"); data/prelink-0.0.20131005/gelf/gelf.c:71: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 (dst->e_ident, ehdr32->e_ident, EI_NIDENT); data/prelink-0.0.20131005/gelf/gelf.c:92: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 (dst, ehdr64, sizeof (Elf64_Ehdr)); data/prelink-0.0.20131005/gelf/gelf.c:111: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 (ehdr32->e_ident, src->e_ident, EI_NIDENT); data/prelink-0.0.20131005/gelf/gelf.c:130: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 (ehdr64, src, sizeof (Elf64_Ehdr)); data/prelink-0.0.20131005/gelf/gelf.c:191: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 (dst, phdr64 + ndx, sizeof (Elf64_Phdr)); data/prelink-0.0.20131005/gelf/gelf.c:236: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 (phdr64 + ndx, src, sizeof (Elf64_Phdr)); data/prelink-0.0.20131005/gelf/gelf.c:284: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 (dst, shdr64, sizeof (Elf64_Shdr)); data/prelink-0.0.20131005/gelf/gelf.c:318: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 (shdr64, src, sizeof (Elf64_Shdr)); data/prelink-0.0.20131005/gelfx32/gelfx.h:66:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. return memcpy (dst, ehdr, sizeof (Elf32_Ehdr)); data/prelink-0.0.20131005/gelfx32/gelfx.h:75: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 (ehdr, src, sizeof (Elf32_Ehdr)); data/prelink-0.0.20131005/gelfx32/gelfx.h:94:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. return memcpy (dst, phdr + ndx, sizeof (Elf32_Phdr)); data/prelink-0.0.20131005/gelfx32/gelfx.h:104: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 (phdr + ndx, src, sizeof (Elf32_Phdr)); data/prelink-0.0.20131005/gelfx32/gelfx.h:123:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. return memcpy (dst, shdr, sizeof (Elf32_Shdr)); data/prelink-0.0.20131005/gelfx32/gelfx.h:132: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 (shdr, src, sizeof (Elf32_Shdr)); data/prelink-0.0.20131005/src/cache.c:367: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 (prelink_cache, O_RDONLY); data/prelink-0.0.20131005/src/cache.c:615: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 ((char *) & cache, PRELINK_CACHE_MAGIC, data/prelink-0.0.20131005/src/cache.c:628: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 data_buf[len]; data/prelink-0.0.20131005/src/cache.c:676: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 prelink_cache_tmp [prelink_cache_len + sizeof (".XXXXXX")]; data/prelink-0.0.20131005/src/cache.c:677: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 (mempcpy (prelink_cache_tmp, prelink_cache, prelink_cache_len), data/prelink-0.0.20131005/src/cache.c:679:8: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp (prelink_cache_tmp); data/prelink-0.0.20131005/src/cache.c:757: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 (s, p, q - p); data/prelink-0.0.20131005/src/cache.c:768: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 (s, p, q - p); data/prelink-0.0.20131005/src/cache.c:780: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 (s, p, q - p); data/prelink-0.0.20131005/src/cache.c:820: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 (s, p, q - p); data/prelink-0.0.20131005/src/canonicalize.c:155: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 (dirname, name, ep->dirname_len); data/prelink-0.0.20131005/src/canonicalize.c:280:21: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. name = end = memcpy (extra_buf, buf, n); data/prelink-0.0.20131005/src/conflict.c:312: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 (buf + off2 - off, data->d_buf + off2, len); data/prelink-0.0.20131005/src/conflict.c:368: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 (buf, info->dynbss + (addr - info->dynbss_base), size); data/prelink-0.0.20131005/src/conflict.c:379: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 (buf, info->sdynbss + (addr - info->sdynbss_base), size); data/prelink-0.0.20131005/src/doit.c:189: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 (mempcpy (move, hardlink->canon_filename, len), ".#prelink#", data/prelink-0.0.20131005/src/dso.c:234: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 (name, O_RDONLY); data/prelink-0.0.20131005/src/dso.c:410: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 (dso->move->old_to_new, invsections, dso->ehdr.e_shnum * sizeof (int)); data/prelink-0.0.20131005/src/dso.c:411: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 (dso->move->new_to_old, sections, dso->ehdr.e_shnum * sizeof (int)); data/prelink-0.0.20131005/src/dso.c:624: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 seen[dso->ehdr.e_shnum]; data/prelink-0.0.20131005/src/dso.c:747: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 filename[strlen (temp_base ? temp_base : dso->filename) data/prelink-0.0.20131005/src/dso.c:770:8: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp (filename); data/prelink-0.0.20131005/src/dso.c:773:7: [2] (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). Risk is low because the source is a constant string. strcpy (filename, "/tmp/#prelink#.XXXXXX"); data/prelink-0.0.20131005/src/dso.c:774:12: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp (filename); data/prelink-0.0.20131005/src/dso.c:777:4: [2] (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). Risk is low because the source is a constant string. strcpy (filename, "/dev/shm/#prelink#.XXXXXX"); data/prelink-0.0.20131005/src/dso.c:778:9: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp (filename); data/prelink-0.0.20131005/src/dso.c:814:10: [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 (e_ident, dso->ehdr.e_ident, EI_NIDENT) == NULL data/prelink-0.0.20131005/src/dso.c:845: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 (data2, data1, sizeof (*data1)); data/prelink-0.0.20131005/src/dso.c:895: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 (data.d_buf + data1->d_off - data.d_off, data1->d_buf, data/prelink-0.0.20131005/src/dso.c:898: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 (data2, &data, sizeof (data)); data/prelink-0.0.20131005/src/dso.c:1584: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 (data->d_buf + data->d_size, name, len + 1); data/prelink-0.0.20131005/src/dso.c:1831:13: [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). fdout = open (name, O_WRONLY | O_CREAT, 0600); data/prelink-0.0.20131005/src/exec.c:108: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 (phdr, dso->phdr, dso->ehdr.e_phnum * sizeof (GElf_Phdr)); data/prelink-0.0.20131005/src/exec.c:109: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 (old_shdr, dso->shdr, dso->ehdr.e_shnum * sizeof (GElf_Shdr)); data/prelink-0.0.20131005/src/exec.c:111: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 (shdr, dso->shdr, dso->ehdr.e_shnum * sizeof (GElf_Shdr)); data/prelink-0.0.20131005/src/exec.c:142: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 (dso->undo.d_buf, data->d_buf, data->d_size); data/prelink-0.0.20131005/src/exec.c:147: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 (shdr_after_undo, shdr, ehdr.e_shnum * sizeof (GElf_Shdr)); data/prelink-0.0.20131005/src/exec.c:440: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 (dso->phdr, phdr, ehdr.e_phnum * sizeof (GElf_Phdr)); data/prelink-0.0.20131005/src/execle_open.c:53:11: [2] (race) vfork: On some old systems, vfork() permits race conditions, and it's very difficult to use correctly (CWE-362). Use fork() instead. switch (vfork ()) data/prelink-0.0.20131005/src/execstack.c:92: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 filename[strlen (dso->filename) + sizeof ".#execstack#.XXXXXX"]; data/prelink-0.0.20131005/src/execstack.c:110:8: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). fd = mkstemp (filename); data/prelink-0.0.20131005/src/execstack.c:126:9: [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 = vfork (); data/prelink-0.0.20131005/src/gather.c:64:9: [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. const char *argv[5]; data/prelink-0.0.20131005/src/gather.c:65:9: [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. const char *envp[4]; data/prelink-0.0.20131005/src/gather.c:127:6: [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 (liblist, data->d_buf, dso->shdr[i].sh_size); data/prelink-0.0.20131005/src/gather.c:157: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 (tp, "./", 2); data/prelink-0.0.20131005/src/gather.c:158: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 (tp + 2, ent->filename, flen + 1); data/prelink-0.0.20131005/src/gather.c:641: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 e_ident [sizeof (Elf64_Ehdr) + sizeof (Elf64_Phdr)]; data/prelink-0.0.20131005/src/gather.c:696: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). fd = open (name, O_RDONLY); data/prelink-0.0.20131005/src/gather.c:892: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 (blacklist_dir, name, blacklist_dir_len - 1); data/prelink-0.0.20131005/src/gather.c:906: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 e_ident [EI_NIDENT + 2]; data/prelink-0.0.20131005/src/gather.c:931: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 (name, O_RDONLY); data/prelink-0.0.20131005/src/gather.c:1059: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 line[1]; data/prelink-0.0.20131005/src/gather.c:1065:16: [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 *file = fopen (config, "r"); data/prelink-0.0.20131005/src/gather.c:1126: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 (c->line, p, llen + 1); data/prelink-0.0.20131005/src/get.c:68: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 buffer[8192]; data/prelink-0.0.20131005/src/get.c:643:9: [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. const char *argv[5]; data/prelink-0.0.20131005/src/get.c:644:9: [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. const char *envp[4]; data/prelink-0.0.20131005/src/get.c:685: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 (p, "./", 2); data/prelink-0.0.20131005/src/get.c:686: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 (p + 2, info->ent->filename, flen + 1); data/prelink-0.0.20131005/src/hashtab.c:533:13: [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 *f = fopen (name, "w"); data/prelink-0.0.20131005/src/hashtab.c:568:13: [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 *f = fopen (name, "r"); data/prelink-0.0.20131005/src/layout.c:375:13: [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 ("/dev/urandom", O_RDONLY); data/prelink-0.0.20131005/src/layout.c:636: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 (deps, l.binlibs[i]->depends, data/prelink-0.0.20131005/src/main.c:308: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 buf[20]; data/prelink-0.0.20131005/src/md5.c:38:23: [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. static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; data/prelink-0.0.20131005/src/md5.c:94: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 (&ctx->buffer[bytes], fillbuf, pad); data/prelink-0.0.20131005/src/md5.c:143: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 (&ctx->buffer[left_over], buffer, add); data/prelink-0.0.20131005/src/md5.c:152: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 (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], data/prelink-0.0.20131005/src/md5.c:167:25: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. md5_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); data/prelink-0.0.20131005/src/md5.c:184: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 (&ctx->buffer[left_over], buffer, len); data/prelink-0.0.20131005/src/md5.c:190: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 (ctx->buffer, &ctx->buffer[64], left_over); data/prelink-0.0.20131005/src/md5.h:39: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 buffer[128]; data/prelink-0.0.20131005/src/mdebug.c:27:24: [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. #define F8(x) unsigned char x[1]; data/prelink-0.0.20131005/src/mdebug.c:28:25: [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. #define F16(x) unsigned char x[2]; data/prelink-0.0.20131005/src/mdebug.c:29:25: [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. #define F24(x) unsigned char x[3]; data/prelink-0.0.20131005/src/mdebug.c:30:25: [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. #define F32(x) unsigned char x[4]; data/prelink-0.0.20131005/src/mdebug.c:31:25: [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. #define F64(x) unsigned char x[8]; data/prelink-0.0.20131005/src/prelink.c:734: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 (data->d_buf + data->d_size, name, len); data/prelink-0.0.20131005/src/prelink.h:349:9: [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. const char magic [sizeof (PRELINK_CACHE_MAGIC) - 1]; data/prelink-0.0.20131005/src/prelink.h:398: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 dir[0]; data/prelink-0.0.20131005/src/sha.c:33:23: [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. static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; data/prelink-0.0.20131005/src/sha.c:89: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 (&ctx->buffer[bytes], fillbuf, pad); data/prelink-0.0.20131005/src/sha.c:131: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 (&ctx->buffer[left_over], buffer, add); data/prelink-0.0.20131005/src/sha.c:140: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 (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], data/prelink-0.0.20131005/src/sha.c:155:25: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. sha_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx); data/prelink-0.0.20131005/src/sha.c:172: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 (&ctx->buffer[left_over], buffer, len); data/prelink-0.0.20131005/src/sha.c:178: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 (ctx->buffer, &ctx->buffer[64], left_over); data/prelink-0.0.20131005/src/sha.h: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 buffer[128]; data/prelink-0.0.20131005/src/space.c:38: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 buf[32], *q; data/prelink-0.0.20131005/src/space.c:84:6: [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, "LOPROC+%x", shdr[i].sh_type - SHT_LOPROC); data/prelink-0.0.20131005/src/space.c:86:6: [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, "LOOS+%x", shdr[i].sh_type - SHT_LOOS); data/prelink-0.0.20131005/src/space.c:88:6: [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, "LOUSER+%x", shdr[i].sh_type - SHT_LOUSER); data/prelink-0.0.20131005/src/space.c:90:6: [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, "Unknown: %x", shdr[i].sh_type); data/prelink-0.0.20131005/src/undo.c:508: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 (old_shdr, dso->shdr, sizeof (GElf_Shdr) * dso->ehdr.e_shnum); data/prelink-0.0.20131005/src/undoall.c:129: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 (mempcpy (move, hardlink->canon_filename, len), ".#prelink#", data/prelink-0.0.20131005/src/verify.c:36: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 buf[65536], *b, *p, *q; data/prelink-0.0.20131005/src/verify.c:90: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 buf[65536+64], *b, *p, *q; data/prelink-0.0.20131005/src/verify.c:146:16: [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 bin_buffer[16]; data/prelink-0.0.20131005/src/verify.c:165:16: [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 bin_buffer[20]; data/prelink-0.0.20131005/src/verify.c:192: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 buffer[32768], buffer2[32768]; data/prelink-0.0.20131005/src/verify.c:272: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 (dso->temp_filename, O_RDONLY); data/prelink-0.0.20131005/src/verify.c:438: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 (filename, O_RDONLY); data/prelink-0.0.20131005/testsuite/ifunc3lib1.c:18: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 lib1b1[4]; data/prelink-0.0.20131005/testsuite/shuffle2.c:4:8: [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. extern char testzero[16384]; data/prelink-0.0.20131005/testsuite/shuffle9.c:4:8: [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. extern char testzero[16384]; data/prelink-0.0.20131005/src/cache.c:598: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). l->len_strings += strlen (e->canon_filename) + 1; data/prelink-0.0.20131005/src/cache.c:675:30: [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 prelink_cache_len = strlen (prelink_cache); data/prelink-0.0.20131005/src/canonicalize.c:162:33: [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). ep->canon_dirname_len = strlen (ep->canon_dirname); data/prelink-0.0.20131005/src/canonicalize.c:271: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). len = strlen (end); data/prelink-0.0.20131005/src/doit.c:175:13: [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 (hardlink->canon_filename); data/prelink-0.0.20131005/src/dso.c:747: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). char filename[strlen (temp_base ? temp_base : dso->filename) data/prelink-0.0.20131005/src/dso.c:1533: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). size_t len = strlen (name); data/prelink-0.0.20131005/src/dso.c:1561: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). size_t len = strlen (name), align; data/prelink-0.0.20131005/src/exec.c:186: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). growdynstr += strlen (info->sonames[i + 1]) + 1; data/prelink-0.0.20131005/src/execstack.c:92: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). char filename[strlen (dso->filename) + sizeof ".#execstack#.XXXXXX"]; data/prelink-0.0.20131005/src/gather.c:155: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). size_t flen = strlen (ent->filename); data/prelink-0.0.20131005/src/gather.c:599: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 (canon_name); data/prelink-0.0.20131005/src/gather.c:657: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 len = strlen (name); data/prelink-0.0.20131005/src/gather.c:700:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (fd, e_ident, sizeof (e_ident)) != sizeof (e_ident)) data/prelink-0.0.20131005/src/gather.c:883:24: [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). blacklist_dir_len = strlen (name) + 1; data/prelink-0.0.20131005/src/gather.c:938:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (fd, e_ident, sizeof (e_ident)) != sizeof (e_ident)) data/prelink-0.0.20131005/src/gather.c:1116: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). llen = strlen (p); data/prelink-0.0.20131005/src/gather.c:1335: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 (canon_name); data/prelink-0.0.20131005/src/gather.c:1373: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). blacklist_ext[blacklist_next].len = strlen (ext); data/prelink-0.0.20131005/src/get.c:683: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). size_t flen = strlen (info->ent->filename); data/prelink-0.0.20131005/src/get.c:693:47: [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). p = alloca (sizeof "LD_TRACE_PRELINKING=" + strlen (info->ent->filename)); data/prelink-0.0.20131005/src/hashtab.c:587:20: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). switch ((c = fgetc (f))) data/prelink-0.0.20131005/src/layout.c:382:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (fd, &x, sizeof (x)) == sizeof (x)) data/prelink-0.0.20131005/src/prelink.c:698: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). strsize += strlen (info->sonames[i + 1]) + 1; data/prelink-0.0.20131005/src/prelink.c:732: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). size_t len = strlen (name) + 1; data/prelink-0.0.20131005/src/undoall.c:115:13: [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 (hardlink->canon_filename); data/prelink-0.0.20131005/src/verify.c:68:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = TEMP_FAILURE_RETRY (read (infd, p, q - p)); data/prelink-0.0.20131005/src/verify.c:110:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). n = TEMP_FAILURE_RETRY (read (fd, p, q - p)); data/prelink-0.0.20131005/src/verify.c:393:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (fdorig, buffer, len) != len) data/prelink-0.0.20131005/src/verify.c:398:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (fd, buffer2, len) != len) ANALYSIS SUMMARY: Hits = 164 Lines analyzed = 32536 in approximately 0.82 seconds (39828 lines/second) Physical Source Lines of Code (SLOC) = 27335 Hits@level = [0] 77 [1] 30 [2] 120 [3] 3 [4] 10 [5] 1 Hits@level+ = [0+] 241 [1+] 164 [2+] 134 [3+] 14 [4+] 11 [5+] 1 Hits/KSLOC@level+ = [0+] 8.81654 [1+] 5.99963 [2+] 4.90214 [3+] 0.512164 [4+] 0.402414 [5+] 0.0365831 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.